[PATCH] Use setproctitle in winbindd

Ralph Böhme slow at samba.org
Tue Jan 9 19:54:45 UTC 2018


On Wed, Jan 10, 2018 at 08:10:17AM +1300, Andrew Bartlett via samba-technical wrote:
> On Tue, 2018-01-09 at 12:07 -0700, Christof Schmitt via samba-technical 
> wrote:
> > On Tue, Jan 09, 2018 at 11:17:57AM +0100, Ralph Böhme via samba-technical wrote:
> > > Hi!
> > > 
> > > Looking at the process list on a Samba DC with all those accurately named samba
> > > processes, I got jealous and wanted the same in winbindd as well.
> > > 
> > > Patch attached, already reviewed by Andreas, so I'm going to push later if noone
> > > objects.
> > > 
> > > How does it look like? Eg:
> > > 
> > > root     31717  0.0  0.9 436076 20028 ?        Ss   Jan06   0:07 ./bin/winbindd -D
> > > root     31724  0.0  0.7 316200 15152 ?        S    Jan06   0:01  \_ winbindd: domain child [TITAN]
> > > root     31727  0.0  0.8 436080 18200 ?        S    Jan06   0:00  \_ winbindd: domain child [WDOM2]
> > > root     31728  0.0  0.9 443576 19112 ?        S    Jan06   0:01  \_ winbindd: idmap child         
> > > root     31729  0.0  0.4 309044  9004 ?        S    Jan06   0:01  \_ winbindd: domain child [BUILTIN]
> > > 
> > > -slow
> > 
> > Hi,
> > 
> > i think this is a good idea. Sometimes it is important to identify a
> > domain child process and currently the only method is checking the open
> > files of the processes for a log file with the domain name.
> > 
> > Have you looked how other parts of the code set the title? For smbd,
> > this is done from reinit_after_fork that then passes the last parameter
> > to prctl_set_comment which then calls
> > prctl(PR_SET_NAME).
> > 
> > It would be good to have a common path to set the process names.
> > 
> > Christof
> 
> I agree.  A pattern where we set the prctl(PR_SET_NAME) with a
> truncated name and the setproctitle with a longer one would be a very
> good idea, ideally as a function that calls both, eg
> set_samba_process_titles(short, long). 

what for? Why calling prctl? My understanding was calling setproctitle is all
that's needed for fancy ps output across the board. Isn't that what the samba
binary calls as well?

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/



More information about the samba-technical mailing list