On Mon, Oct 20, 2014 at 05:35:24PM +0300, George Angelopoulos wrote: > When postgresql is stopped, '/etc/rc.d/postgresql check' returns 3, but > according to rc.subr(8) it should return 1. > > The rc.script basically uses: > > /usr/local/bin/pg_ctl -D /var/postgresql/data/ status > > According to pg_ctl(1), an exit status of 3 does indeed mean that > postgresql is not running. > > > status mode checks whether a server is running in the specified data > > directory. If it is, the PID and the command line options that were > > used to invoke it are displayed. If the server is not running, the > > process returns an exit status of 3. > > However, according to rc.subr(8), the rc script should return 1. > >check Call rc_check. Return 0 if the daemon is running or > > 1 if it is not. > > > My personal problem is that I use ansible for checking service status. > Ansible assumes that '/etc/rc.d/postgresql status' will will return > either 0 or 1, and fails if it returns everything else. As I understand > it, this is correct according to rc.subr(8), but maybe ansible should be > more lenient and just check for non-zero exit instead of '1'. Who's > really at fault here?
The postgresql rc script is at fault. -- Antoine
