> On 27.01.2016, at 23:31, Stuart Henderson <s...@spacehopper.org> wrote:
>
> On 2016-01-27, Antoine Jacoutot <ajacou...@bsdfrog.org> wrote:
>> On Wed, Jan 27, 2016 at 12:30:08PM +0100, Reyk Floeter wrote:
>>> On Wed, Jan 27, 2016 at 06:12:22AM -0500, Jiri B wrote:
>>>> Hi,
>>>>
>>>> I can't run multiple instances of httpd via rc.d as I can't distinguish
>>>> between httpd instances. ps aux never show flags passed to httpd.
>>>>
>>>> Could httpd be extended to show flags like sshd does it?
>>>>
>>>> root     15681  0.0  0.1  1196  2308 ??  Ssp   12:08PM    0:00.05 httpd:
parent (httpd)
>>>>
>>>> vs
>>>>
>>>> root     17247  0.0  0.1   920  1376 ??  Ss    12:09PM    0:00.03
/usr/sbin/sshd -f /etc/ssh/test_sshd_config
>>>>
>>>> Or is there any other way to distinguish between two httpd instances?
>>>>
>>>> j.
>>>>
>>>
>>> Interesting point, I never thought about it.
>>
>> That's not httpd specific. Most of our privilege separated daemons do that
and it sucks :-)
>
> This does the trick. It probably doesn't make sense to run multiple
> copies of all of the privsep daemons though I see definite use cases
> for httpd, snmpd [v4 and v6 need separate daemons], and possibly some
> others, but it would be better to keep them all in-sync..
>

Fine, this is what I suggested as the first option.

But let's do it everywhere and not just for httpd -
don't use setproctitle in the parent process.

It does make sense for many more privsep daemons, especially in combination
with rdomains (ntpd, iked, …). bgpd would probably not need it, but it does
not harm
and I'd prefer to change it for consistency (please don't forget that we try
to keep
the daemons synced somehow - it's an ecosystem).

Reyk

> Index: etc/rc.d/httpd
> ===================================================================
> RCS file: /cvs/src/etc/rc.d/httpd,v
> retrieving revision 1.3
> diff -u -p -r1.3 httpd
> --- etc/rc.d/httpd    22 Jul 2014 17:37:16 -0000      1.3
> +++ etc/rc.d/httpd    27 Jan 2016 22:22:11 -0000
> @@ -6,6 +6,4 @@ daemon="/usr/sbin/httpd"
>
> . /etc/rc.d/rc.subr
>
> -pexp="httpd: parent.*"
> -
> rc_cmd $1
> Index: usr.sbin/httpd/httpd.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/httpd/httpd.c,v
> retrieving revision 1.53
> diff -u -p -r1.53 httpd.c
> --- usr.sbin/httpd/httpd.c    3 Dec 2015 11:46:25 -0000       1.53
> +++ usr.sbin/httpd/httpd.c    27 Jan 2016 22:22:11 -0000
> @@ -248,7 +248,6 @@ main(int argc, char *argv[])
>
>       proc_init(ps, procs, nitems(procs));
>
> -     setproctitle("parent");
>       log_procinit("parent");
>
>       if (pledge("stdio rpath wpath cpath inet dns proc ioctl sendfd",

Reply via email to