s3-daemons: Set the comment field of the daemons.

Andreas Schneider asn at samba.org
Wed Mar 6 01:36:24 MST 2013


On Wednesday 06 March 2013 19:03:31 Andrew Bartlett wrote:
> On Wed, 2013-03-06 at 01:17 +0100, David Disseldorp wrote:
> > commit f06a0352e551ea125675659923c909d6d4c473fd
> > Author: Andreas Schneider <asn at samba.org>
> > Date:   Mon Feb 25 10:41:18 2013 +0100
> > 
> >     s3-daemons: Set the comment field of the daemons.
> >     
> >     PR_SET_NAME sets the comm field of a process. This way we can give
> >     processes a name and they are easier to identify.
> >     
> >     $ ps afx -o pid,comm
> >     29447 smbd
> >     29452  \_ epmd
> >     29453  \_ lsasd-master
> >     29455  |   \_ lsasd-child
> >     29457  |   \_ lsasd-child
> >     29459  |   \_ lsasd-child
> >     29461  |   \_ lsasd-child
> >     29463  |   \_ lsasd-child
> >     29454  \_ spoolssd-master
> >     29456      \_ lpqd
> >     29458      \_ spoolssd-child
> >     29460      \_ spoolssd-child
> >     29462      \_ spoolssd-child
> >     29465      \_ spoolssd-child
> >     29466      \_ spoolssd-child
> >     29467      \_ spoolssd-child
> >     29468      \_ spoolssd-child
> >     29469      \_ spoolssd-child
> >     29470      \_ spoolssd-child
> >     29471      \_ spoolssd-child
> >     
> >     Reviewed-by: David Disseldorp <ddiss at samba.org>
> 
> G'Day,

Hi Andrew,

> Can you handle all the other callers to setproctitle also please?
> 
> Ideally we would have one function call that calls both of these
> (setproctitle is a no-op on Linux), to mean 'try as hard as you can to
> name this process.

https://git.samba.org/?p=asn/samba.git;a=shortlog;h=refs/heads/s3-fixes

I've added that now so that setproctitle is used if available. However we have 
a problem here. PR_SET_NAME is limited to 16 chars (including \0) and 
setproctitle obviously allows more.

So I can't replace the calls in s4 cause they are much bigger. The next thing 
is that prctl needs to point to a static string.


	-- andreas

-- 
Andreas Schneider                   GPG-ID: F33E3FC6
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list