[systemd-devel] stdout logging to journal doesn't survive journal restart
Colin Guthrie
gmane at colin.guthr.ie
Thu Oct 18 06:36:11 PDT 2012
'Twas brillig, and Dave Reisner at 18/10/12 08:32 did gyre and gimble:
> Hey,
>
> I'm noticing that if you ever have to restart the journal, services
> which log to /run/systemd/journal/stdout lose their connection. You can
> reproduce this systemd-cat pretty easily:
>
> ( {
> echo "this is logged"
> echo "sleep 5 seconds..." >&2
> sleep 5
> echo "done sleeping...." >&2
> echo "this is never logged!"
> } |& systemd-cat ) &
>
> sleep 2
> systemctl restart systemd-journald
> wait
>
> Of course, restarting the service will solve this, but it seems a bit
> uncool...
>
> I strongly suspect that its related that connections to the socket are
> dup'd for every service, i.e.
>
> $ grep -F /run/systemd/journal/stdout /proc/net/unix
> ffff88032d5e8680: 00000002 00000000 00010000 0001 01 136 /run/systemd/journal/stdout
> ffff88032cdce800: 00000003 00000000 00000000 0001 03 3369 /run/systemd/journal/stdout
> ffff88032d477500: 00000003 00000000 00000000 0001 03 3364 /run/systemd/journal/stdout
> ffff88032d477b80: 00000003 00000000 00000000 0001 03 3366 /run/systemd/journal/stdout
> ffff88032d6b9d40: 00000003 00000000 00000000 0001 03 8686 /run/systemd/journal/stdout
> ffff88032cdcd7c0: 00000003 00000000 00000000 0001 03 7467 /run/systemd/journal/stdout
> ffff88032d470680: 00000003 00000000 00000000 0001 03 2136114 /run/systemd/journal/stdout
> ffff88032d6bb400: 00000003 00000000 00000000 0001 03 10570 /run/systemd/journal/stdout
>
> This doesn't affect processes which connect to /run/systemd/journal/socket
> via the various API, and only a single instance of this socket ever
> appears in /proc/net/unix.
>
> Any ideas?
This was discussed on IRC a couple days ago.
I paraphrased Lennart's reply there in this bug report (see my last
comment):
https://bugs.freedesktop.org/show_bug.cgi?id=56043
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited http://www.tribalogic.net/
Open Source:
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the systemd-devel
mailing list