chiark / gitweb /
activate: clean up inherited descriptors
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 11 Dec 2013 02:52:11 +0000 (21:52 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 11 Dec 2013 02:52:57 +0000 (21:52 -0500)
commitc099716487df4a4f5394e57e7ca14da1d358166a
treeb5d73d9a543fc4f7767a46edb3268147aa689157
parent8be12848423218c034cfa7e3078774c9d4732281
activate: clean up inherited descriptors

> [simon@troela server]$ /usr/lib/systemd/systemd-activate -l 9000 main.js
> Assertion 'fd == 3 + count' failed at src/activate/activate.c:115,
> function open_sockets(). Aborting.
> Aborted (core dumped)

> after a bit debuging i found the problem:
> slim appears to leak an fd into all of its children:
> stat /proc/14004/fd/3  (14004 is the pid a random process in my session)
>  File: '/proc/14004/fd/3' -> '/var/log/slim.log'

systemd-activate should be robust against the shell (or anything else) leaking
descriptors. Now everything except stdin/stdout/stderr and received sockets
will be closed.
src/activate/activate.c