[PATCH] Use setproctitle in winbindd
Andrew Bartlett
abartlet at samba.org
Tue Jan 9 19:10:17 UTC 2018
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).
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list