[systemd-devel] stdout logging to journal doesn't survive journal restart

Dave Reisner d at falconindy.com
Thu Oct 18 00:32:41 PDT 2012


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?

d


More information about the systemd-devel mailing list