Bug 30498 - socket is not given back to systemd if service is killed
Summary: socket is not given back to systemd if service is killed
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-30 06:24 UTC by Michael Biebl
Modified: 2011-03-08 12:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Biebl 2010-09-30 06:24:49 UTC
I've installed rsyslog 5.7.0 which has native socket activation support and the unit files from http://0pointer.de/public/systemd-units/.

When I run "systemctl start rsyslog.socket", the /dev/log socket is correctly created and running "logger foo" will start the rsyslog service, which takes over /dev/log.

If I then kill the rsyslog daemon process (either with kill $pid or systemctl stop rsyslog.service), there is no more /dev/log so the socket activation no longer works.

It looks like the socket /dev/log is not correctly given back to systemd/rsyslog.socket.
Comment 1 Michael Biebl 2010-09-30 06:38:12 UTC
(In reply to comment #0)
> 
> It looks like the socket /dev/log is not correctly given back to
> systemd/rsyslog.socket.

After further discussion with mezcalero on irc, this looks like a problem in rsyslog, which unlink's /dev/log on shutdown, whereas it shouldn't do that when in sd socket activation mode.
Comment 2 Michael Biebl 2010-10-01 18:25:46 UTC
(In reply to comment #1)
> After further discussion with mezcalero on irc, this looks like a problem in
> rsyslog, which unlink's /dev/log on shutdown, whereas it shouldn't do that when
> in sd socket activation mode.

Filed a corresponding bug report in the upstream rsyslog bug tracker:

http://bugzilla.adiscon.com/show_bug.cgi?id=200
Comment 3 Rainer Gerhards 2010-10-02 09:47:22 UTC
This is definitely a bug in rsyslog and I'll fix it there.
Comment 4 Rainer Gerhards 2010-10-04 07:21:59 UTC
Hi Lennart,

there now is an upstream fix (to be released with 5.7.1 soon), but Michael raised an interesting question that needs your attention. Please see this post:

http://bugzilla.adiscon.com/show_bug.cgi?id=200#c6

Rainer
Comment 5 Lennart Poettering 2010-10-05 14:35:41 UTC
Which question precisely? A stale socket should be fine.

I think the only remotely race-free way to handle all of this is to delete the socket in the last possible moment, i.e. right before creating a new one. Ideally we'd even make this atomically, which we probably could do with renaming or so...
Comment 6 Lennart Poettering 2011-03-08 07:58:51 UTC
BTW, this bug can be closed now, right?
Comment 7 Lennart Poettering 2011-03-08 08:04:27 UTC
Closing, feel free to reopen if there's still a problem left.
Comment 8 Michael Biebl 2011-03-08 12:29:11 UTC
(In reply to comment #6)
> BTW, this bug can be closed now, right?

Yeah, I think you explained sufficiently why you keep the socket around.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.