mirror of
https://github.com/systemd/systemd.git
synced 2026-11-06 05:17:24 +00:00
journald keeps track of stream metadata in files identified by dev and inode numbers. However for sockets, the kernel returns a number that's truncated to 32 bits. On busy systems, that number can overflow and be attributed to another service, which will remove the file on exit. When journald gets restarted, when trying to restore objects, it will see that the file is missing and emit an error: `systemd-journald[228270]: 1 unknown file descriptors passed, closing`. PID 1 will then retain the fd and future writes from the daemon that was using that stream will end up being stuck in the socket that nothing drains. This PR fixes this by appending `SO_COOKIE` to the name of the stream. If supports old style streams so that upgrades work and older builds will load the stream by looking only at the dev and inode, so that rollbacks work.