[pgsql-jp: 28995] Re: cygwin環境下でのpostmaster 起動について

Tamotsu Ebina ebina @ pluto.dti.ne.jp
2003年 2月 10日 (月) 15:07:25 JST


海老名@インフォテックです。

> 参考図書「WindowsユーザーのためのPostgreSQL導入活用ガイド」を見ながら、
> インストールを行っていたのですが、
> データベースの初期化(initdb)まで完了して、
> postmasterの起動をと、
> 
> $ /usr/local/pgsql/bin/postmaster
> 
> とシェルに打ち込んでメッセージが出たまではよいのですが、
> 最後のメッセージが
> 
> Log: database system is ready
> と出た後、全く動かなくなり、なんの反応もなくなってしまいます。

正常な動作です。
バックグランドJOBにするなら (pathが pgsql/bin に通っているとして)
$ postmaster -i &
と & を最後につければ、コントロールが戻ってきます。

(-i オプションはネット経由で接続する場合に必要。)

> そこで、シェルを強制終了し、(ここがまずいかも)
> 
> $ /usr/local/pgsql/bin/psql template1
> 
> と打つと、
> 
> psql: could not connect to server: Cannot refused
> Is the server running locally and accepting connections
> on Unix domain socket "/tmp/.s.PGSQL.5432"?

postmaster がお亡くなりになっているので当然コネクトできません
のでこれも正常な動作です。

再度
$ postmaster -i &
を実行すると
$ Found a pre-existing shared memory block (key 5432001, id 0) still in use.
If you're sure there are no old backends still running,
remove the shared memory block with ipcrm(1), or just
delete "/usr/local/pgsql/data/postmaster.pid".

というエラーになると思います。
このときは単純に
rm /usr/local/pgsql/data/postmaster.pid
でpostmaster.pidを削除し、再度
$ postmaster -i &
を実行すれば立ち上がります。

& オプションを付けない場合は、別のcygwinのウインドウを開いて
そちらからコマンドを入力します。
& オプションはpostmasterに限らずUNIXのコマンドを
バックグラウンドで実行させたい時につけます。




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