On Sun, Jan 11, 2015 at 02:04:50PM +0100, Antoine Jacoutot wrote:
> On Sun, Jan 11, 2015 at 01:45:59PM +0100, Simon Bertrang wrote:
> > On Sun, Jan 11, 2015 at 01:34:27PM +0100, Antoine Jacoutot wrote:
> > > On Sun, Jan 11, 2015 at 12:57:42PM +0100, Simon Bertrang wrote:
> > > > Hi,
> > > > 
> > > > According to rc.subr(8) rc_check should return exit code 0 or 1 but
> > > 
> > > Not really no. The "check" action should return 0|1.
> > > 
> > 
> > Ah right, different layer - same underlying thing though:
> > postgresql.rc defines rc_check() which calls pg_ctl which does NOT
> > return 0|1 but instead 3|?.
> > 
> > > > for a running postgresql instance pg_ctl(1) returns 3. In the manpage
> > > > under status it says: If the server is not running, the process returns
> > > > an exit status of 3.
> > > > 
> > > > Below a patch to fix that - can someone please take care of it?
> > > 
> > > Does this fix an actual issue?
> > > 
> > 
> > Yes, scripts or in my case automation tools that expect the status
> > to match what is defined in rc.subr(8).
> > Ansible fails to restart postgresql because of this to name a specific
> 
> No idea how ansible is handling services, so I can answer here.
> 
> > issue with it.
> 
> Is there a way I can reproduce your issue?
> Because this looks fine to me:
> 
> $ sudo /etc/rc.d/postgresql check; echo $?
> postgresql(failed)
> 1
> 

Uhm, thanks! That was on 5.6, not a snapshot. The corresponding
code in rc.subr changed in the meantime (revision 1.81 has the fix).
So this is not an issue anymore, move along; sorry for missing
the snapshot step :-/.

Remains to document the behaviour until 5.6 for this:

$ sudo /etc/rc.d/postgresql check; echo $? 
3

Cheers,
Simon

Reply via email to