[PATCH] ctdb-common: Set close-on-exec when creating PID file (bug 12898)

Martin Schwenke martin at meltin.net
Tue Aug 1 08:07:55 UTC 2017


On Mon, 31 Jul 2017 18:55:57 +0200, Volker Lendecke
<Volker.Lendecke at SerNet.DE> wrote:

> On Mon, Jul 31, 2017 at 11:37:54AM +0200, Volker Lendecke wrote:
> > On Mon, Jul 31, 2017 at 03:44:46PM +1000, Martin Schwenke wrote:  
> > > Patch attached.
> > > 
> > > Obvious extensions to this include:
> > > 
> > > * Move pidfile_context_create() to lib/util/pidfile.*
> > > 
> > >   This means that ctdb/common/pidfile.* would be
> > >   completely removed.  Also pidfile_path_create() and pidfile_close()
> > >   would be static.
> > > 
> > > * Add documentation to lib/util/pidfile.h
> > > 
> > >   I didn't want to do this until I knew whether pidfile_path_create()
> > >   and pidfile_close() will disappear from there.  ;-)
> > > 
> > > Please review and maybe push...  
> > 
> > Great, thanks! Pushed!  
> 
> Hmm. Fails with
> 
> [50(716)/2182 at 11m38s] wafsamba.duplicate_symbols
> Waf: Entering directory `/memdisk/vlendec/a/b456000/samba/bin'
>         Selected embedded Heimdal build
> [4090/4214] symbol duplicate checking:
> Waf: Leaving directory `/memdisk/vlendec/a/b456000/samba/bin'
> Build failed:
> default/source3/lib/netapi/examples/localgroup/localgroup_setinfo: Symbol pidfile_close linked in multiple libraries ['samba-util', '/lib/x86_64-linux-gnu/libbsd.so.0.6.0']
> UNEXPECTED(failure):
> wafsamba.duplicate_symbols.duplicate_symbols(none)
> REASON: Exception: Exception:
> 
> Can you check?

Sorry...

OK, I've renamed pidfile_close() -> pidfile_fd_close() to stop it
colliding with the BSD pidfile_close().  It now passes a private
autobuild on sn-devel.  New patch attached.

When this is in I'll do the extra commit to add documentation to
lib/util/pidfile.h.

The BSD pidfile_*() functions actually look pretty good - I've only
scanned the manpage. Perhaps in the future we can switch to them or wrap
them. Before doing that I'd like to look at their current
implementation.  ;-)

peace & happiness,
martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba.patch
Type: text/x-patch
Size: 16551 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170801/190b3c10/samba.bin>


More information about the samba-technical mailing list