[pgsql-jp: 25847] Linux 用起動スクリプトについて

Osamu Shigematsu shige @ ravi.ne.jp
2002年 5月 7日 (火) 08:40:36 JST


こんにちは。重松です。

VineLinux 2.5 を新規インストールして、
PostgreSQL も新規にインストールし直していて、ふと思ったことがあるのですが、
シーラカンス本の P50 あたりの Linux 用起動スクリプトに、

	su - $PGACCOUNT -c "$POSTMASTER -D $PGDATA &"

という行があります。

起動する際には、pg_ctl も使えると思うのですが。
そこで以下のように書き直してみたのですが、postmaster を使わないと
何か問題があるのでしょうか。

アドバイスいただければ幸いです。

#!/bin/sh
#
# chkconfig:    345 85 15
# description:  Starts and stops the PostgreSQL backend daemon \
#               that handles all database requests.

PGACCOUNT="postgres"
PG_CTL="/usr/local/pgsql/bin/pg_ctl"

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

case "$1" in
         start)
         echo -n "Starting postgres: "
         su - $PGACCOUNT -c "$PG_CTL start"
         echo
         touch /var/lock/subsys/postgres
         ;;

         stop)
         echo -n "Stopping postgres: "
         su - $PGACCOUNT -c "$PG_CTL -w -m f stop"
         echo
         rm -f /var/lock/subsys/postgres
         ;;

         *)
         echo "Usage: $0 {start|stop}"
         exit 1
esac

exit 0

--
Osamu Shigematsu
mailto:shige @ ravi.ne.jp




pgsql-jp メーリングリストの案内