re: how to start postmaster at system boot on linux?

Поиск
Список
Период
Сортировка
От Silvio Emanuel Barbosa de Macedo
Тема re: how to start postmaster at system boot on linux?
Дата
Msg-id Pine.GSO.3.96.990316084721.23704H-200000@newton.inescn.pt
обсуждение исходный текст
Ответ на how to start postmaster at system boot on linux?  ("Bernhard Krick" <h9151366@obelix.wu-wien.ac.at>)
Список pgsql-general
>how to start postmaster at system boot  on linux?

Hi! This question has probably been answered before, but here is my
suggestion ( more or less  copy&paste from the pg rpm):

(in attach)

Copy the file to /etc/rc.d/init.d and then proceed with normal config of
SysV runlevels to start it on, for example, runlevel 3.
(you can use control-panel to get there or you can do it manually, look at
other examples in /etc/rc.d/rc3.d ...they are sym links...).

In the update scritpt, you should do some cleanning (ie: vaccum).

Regards,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
`````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo
mailto:smacedo@inescn.pt

INESC - Porto - Grupo CAV
Pc da Republica, 93 R/C   Tel:351 2 209 42 21
4000 PORTO  PORTUGAL      Fax:351 2 208 41 72






#!/bin/sh
# SILVIO 98-12-22
# postgresql    This is the init script for starting up the PostgreSQL
#        server
#
# chkconfig: 345 85 15
# description: Starts and stops the PostgreSQL backend daemon that handles \
#           all database requests.
# processname: postmaster
# pidfile: /var/run/postmaster.pid
# 

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network


# Check that networking is up.
# Pretty much need it for postmaster.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/local/pgsql/bin/postmaster ] || exit 0


# This script is slightly unusual in that the name of the daemon (postmaster)
# is not the same as the name of the subsystem (postgresql)

# See how we were called.
case "$1" in
  start)
    echo -n "Starting postgresql service: "
    su postgres -c '/usr/local/pgsql/bin/postmaster -i -S -D/usr/local/pgsql/data'
    sleep 1
    pid=`pidof postmaster`
    echo -n "postmaster [$pid]"
    touch /var/lock/subsys/postgresql
    echo $pid > /var/run/postmaster.pid
    echo
    ;;
  stop)
    echo -n "Stopping postgresql service: "
    killproc postmaster
    sleep 2
    rm -f /var/run/postmaster.pid
    rm -f /var/lock/subsys/postgresql
    echo
    ;;
  status)
    status postmaster
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo "Usage: postgresql {start|stop|status|restart}"
    exit 1
esac

exit 0

В списке pgsql-general по дате отправления:

Предыдущее
От: "Doug Smith"
Дата:
Сообщение: ...
Следующее
От: Anto Prijosoesilo
Дата:
Сообщение: Problem with backend crashing