[pgsql-jp: 36394] Re: PostgreSQLのスタート

Katumi Miyao kattyan @ nakayosi.jp
2005年 11月 15日 (火) 21:38:28 JST


宮尾です。
また、分からないところが出てきました。
問題1
インストール後の環境設定で、いろいろとやってrestartをすると、
ファイルが見たらないと言われエラーが出ました。
[root @ himawari root]# /etc/rc.d/init.d/pgsql start
Starting PostgreSQL: ok
[root @ himawari root]# /etc/rc.d/init.d/pgsql restart
Restarting PostgreSQL: pg_ctl: PID file "/usr/local/pgsql/data/postmaster.pid" does not exist
Is postmaster running?
[root @ himawari root]# ls /usr/local/pgsql/data/p*
pg_clog          pg_ident.conf    pg_tblspc        postgresql.conf
pg_hba.conf      pg_subtrans      pg_xlog          postmaster.opts
実際にサービスを停止させるpostmaster.pidが有りませんでした。
この場合どの様に対処すればよろしいのですか?

問題2
インストール後 /home/postgres/.bash_profile を下記のように設定して再起動後
postgresユーザーになり直にはコマンドが使えず command not found になってしまいました。
環境設定を反映すると普通のコマンドが使えるようになりました
reboot すると ~/.bash_profile は反映されると思っていたのですがだめでした。
どこで設定すれば反映されるのですか
PostgreSQLのマニュアルに有るPATHの環境設定は下記と同じ意味に思えますが
いかがなのでしょうか?
http://www.postgresql.jp/document/pg810doc/html/install-post.html#AEN16591
環境設定の内様は書きの通りです。(抜粋)
[postgres @ himawari pgsql]$ vi /home/postgres/.bashrc
# 下記を追加 #
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
[postgres @ himawari pgsql]$ vi /home/postgres/.bash_profile
# 下記を追加 #
PG=/usr/local/pgsql
export PATH=$PATH:$PG/bin
export MANPATH=$MANPATH:$PG/man
export PGLIB=$PG/lib
export PGDATA=$PG/data
[root @ himawari root]# cp /usr/local/src/postgresql-8.0.4/contrib/start-scripts/linux /etc/rc.d/init.d/pgsql
[root @ himawari root]# chmod 755 /etc/rc.d/init.d/pgsql
/etc/rc.d/init.d/pgsqlはデフォルトのまま
[root @ himawari root]# /etc/rc.d/init.d/pgsql start
Starting PostgreSQL: ok
[root @ himawari root]# chkconfig --add pgsql
##試しにOSの再起動
[root @ himawari root]# su postgres
[postgres @ himawari root]$ cd
[postgres @ himawari postgres]$ psql --version
bash: psql: command not found
[postgres @ himawari postgres]$ source ~/.bash_profile
[postgres @ himawari postgres]$ psql --version
could not change directory to "/root"
psql (PostgreSQL) 8.0.4

問題2に対し変更を加えて試した結果
[root @ himawari postgres]# vi /etc/rc.d/init.d/pgsql
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
の部分を
PATH=/usr/local/pgsql/bin
[root @ himawari postgres]# /etc/rc.d/init.d/pgsql restart
Restarting PostgreSQL: /etc/rc.d/init.d/pgsql: line 84: su: command not found
OSの再起動後
[postgres @ himawari root]$ psql --version
bash: psql: command not found

御指導よろしくお願いします



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