PostgreSQL 自動起動@Vine Linux 4.1 [PostgreSQL]
Vine Linux 4.1 で PostgreSQL を自動起動するように設定する。
PostgreSQLのソースコードに起動スクリプトが含まれているのでそれを利用する。
起動スクリプトをコピーする。/usr/local/src/postgresql-8.2.3にソースがあると仮定
# cp /usr/local/src/postgresql-8.2.3/contrib/start-scripts/linux /etc/rc.d/init.d/postgresql
# chmod 755 /etc/rc.d/init.d/postgresql
# cd /etc/rc.d/init.d
# chkconfig --add postgresql
起動スクリプトを環境に合わせて編集する。
# vi /etc/rc.d/init.d/postgresql
# Installation prefix
prefix=/usr/local/pgsql
# Data directory
PGDATA="/usr/local/pgsql/data"
# Who to run the postmaster as, usually "postgres". (NOT "root")
PGUSER=postgres
# Where to keep a log file
PGLOG="$PGDATA/serverlog"
正常に起動できることを確認する。
# su - root # /etc/rc.d/init.d/postgresql start
OKなら次回からLinux起動時にPostgreSQLも自動起動するようになる。