Stuart Henderson, 22 Sep 2014 21:09: > it may be allowed to run it, but ... > > <sthen@hub:~:1278>$ pg_ctl -D /var/postgresql status > pg_ctl: no server running > > <sthen@hub:~:1279>$ pgrep -lf postg > 15784 postgres: stats collector process > 12782 postgres: autovacuum launcher process > 1792 postgres: wal writer process > 1744 postgres: writer process > 27185 postgres: checkpointer process > 7867 /usr/local/bin/postgres -D /var/postgresql/data
this works for me: $ sudo /etc/rc.d/postgresql start postgresql(ok) $ sudo su - _postgresql $ pg_ctl -D /var/postgresql/data status pg_ctl: server is running (PID: 30636) /usr/local/bin/postgres "-D" "/var/postgresql/data" > problem with multi-process servers is how to decide which process > indicates that it's actually running. I'm happier to defer to > the software's own checks if they make sense (and I think they do > here). i would say that for checking the main postgres process is a good bet. it also differentiates between -D datadirs, so it is good for checking multiple instances as well. regarding the check, i am afraid it is not as good as it seems. this is my running instance: -+- 30636 _postgresql /usr/local/bin/postgres -D /var/postgresql/data |--= 07948 _postgresql postgres: checkpointer process (postgres) |--= 30292 _postgresql postgres: wal writer process (postgres) |--= 14555 _postgresql postgres: writer process (postgres) |--= 18537 _postgresql postgres: stats collector process (postgres) \--= 21453 _postgresql postgres: autovacuum launcher process (postgres) unfortunately postgres seems to be quite keen on pid files. $ pg_ctl -D /var/postgresql/data status pg_ctl: server is running (PID: 30636) /usr/local/bin/postgres "-D" "/var/postgresql/data" $ cd /var/postgresql/data $ mv postmaster.pid postmaster.pid.orig $ pg_ctl -D /var/postgresql/data status pg_ctl: no server running so that is the "check". it basically prints postmaster.pid and postmaster.opts i'll take pgrep any day over that. -f -- petting: a study of anatomy in braille...
