#!/bin/sh POSTGRESDIR=/usr/local/pgsql if [ -x /usr/local/pgsql/bin/postmaster -a -d /usr/local/pgsql/data ];then rm -f /tmp/.s.PGSQL.5432 su -l - postgres -c "/usr/local/pgsql/bin/postmaster -S -i" echo -n 'PostgreSQL Service Started' fi
を置いたのですがログイン後、コマンドラインでpsql -lを実行すると
Connection to database 'template1' failed. connectDB() -- connect() failed: No such file or directory Is the postmaster running at 'localhost' and accepting connections on Unix socket '5432'?
>>355 su postgres -c "/usr/local/pgsql/bin/postmaster -S -i" じゃダメ? root から実行すれ。
>>358 top はフリーソフトだから拾ってきてコンパイルすれ。
360 :343 :2001/02/26(月) 11:32
357さん、359さんレスありがとうございます。
rootから su postgres -c "/usr/local/pgsql/bin/postmaster -S -i" を実行すると起動できましたが、例えばtestユーザーから上記のコマンドを 実行すると、パスワードを要求してきます。
シーラカンス本の載っている自動起動スクリプトを書いているんですけど、psql -lのようなコマンドを実行すると Connection to database 'template1' failed. connectDB() -- connect() failed: No such file or directory Is the postmaster running at 'localhost' and accepting connections on Unix socket '5432'? というようなメッセージが表示されます。
どうすればpostmasterの自動起動が出来るのか、わかりませんか?
361 :359 :2001/02/26(月) 12:27
>>360 一般ユーザから su するとパスワード付きの場合は聞いてくるのがあたりまえだよ。 rc?.d で自動起動しようとしてるみたいだから、rootで実行してOKならそれで いいと思うよ。rc?.dの起動シェルを書き換えてリブートしてみそ。
if [ -x $POSTGRESDIR/bin/postmaster -a -d $POSTGRESDIR/data ];then rm -f /tmp/.s.PGSQL.5432 su - postgres -c "/opt/local/pgsql/bin/postmaster -S -i" echo -n 'PostgreSQL Service Started' fi
オレもつくづく暇人だよなぁ・・・。 if [ -x $POSTGRESDIR/bin/postmaster -a -d $POSTGRESDIR/data ];then を if [ -x $POSTGRESDIR/bin/postmaster -a -d $POSTGRESDIR/data ] then に、 su - postgres -c "/opt/local/pgsql/bin/postmaster -S -i" の行を su postgres -c "/opt/local/pgsql/bin/postmaster -S -i" と直してみれ。
if [ -x $POSTGRESDIR/bin/postmaster -a -d $POSTGRESDIR/data ] then rm -f /tmp/.s.PGSQL.5432 su postgres -c "/opt/local/pgsql/bin/postmaster -S -i" echo -n 'PostgreSQL Service Started' fi --------------------------------------------------------------