[PATCH] CTDB PID file fixes (bug 12287)

Martin Schwenke martin at meltin.net
Fri Oct 14 01:55:03 UTC 2016


On Thu, 13 Oct 2016 14:21:46 +0200, Volker Lendecke <vl at samba.org>
wrote:

> Martin Schwenke <martin at meltin.net> writes:
> 
> > 3 patches to improve CTDB PID file handling in ctdbd_wrapper.
> >
> > The 1st patch is an additional patch for bug 12287, so will be
> > backported.
> >
> > The others can just go into master and won't need a backport.  
> 
> The third one seems RHEL-specific. At least Ubuntu gives an error
> message:
> 
> vlendec at sn-devel-144:~/autobuild/samba-autobuild$ ps -h -q 1 -o comm
> error: unsupported SysV option
> 
> Usage:
>  ps [options]
> 
>  Try 'ps --help <simple|list|output|threads|misc|all>'
>    or 'ps --help <s|l|o|t|m|a>'
>     for additional help text.
> 
> For more details see ps(1).
> 
> So to get the rest in I had to drop patch 3/3.

Thanks for catching this!

My hand testing and testing on RHEL 6.8 all seemed to work.  On closer
examination, there were warnings being printed when ps was used with
the -h option.

The options available in different versions are bizarre!

* Debian testing has a variant of 3.3.12.  This supports both the -q
  and -h options.

* Ubuntu 14.04.5 has a variant of 3.3.9.  This supports the -h option
  but not -q.  This makes sense because -q was added in 3.3.10 (around
  June 2015).

* RHEL 6.8 has a variant of 3.2.8.  This supports the -q option but not
  -h.  It looks like it contains a backport of -q.

I used -q because the -p option is an idiot.  With -p you are always
going to get a single process.  However, "ps -p 1" walks every
process' subdirectory in /proc/, collects the desired information and
then filters it to print information about just the one process.  While
I understand the benefits of re-usable code, I don't understand why
this can't be a special case...

Updated patch attached.  Please review and maybe push...

peace & happiness,
martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ctdb-scripts-Strengthen-check-to-see-if-ctdbd-is-run.patch
Type: text/x-patch
Size: 1607 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161014/f5488bcc/0001-ctdb-scripts-Strengthen-check-to-see-if-ctdbd-is-run.bin>


More information about the samba-technical mailing list