17

Doing a ps on my Linux box shows that systemd runs with the command line options --switched-root and --deserialize. Nothing in the man page or /usr/share/doc/systemd mentions them, and Google hasn't been much help. So, what do they do? I'm guessing that --switched-root has something to do with pivot_root, but that's just a guess.

1
  • 1
    Good point, same here on Arch: my process n. 1 is systemd --system --deserialize 18. Again no clue from man. Oct 30 '13 at 11:52
20

These are intentionally undocumented internal parts of systemd. Very simply, therefore:

  • --deserialize is used to restore saved internal state that a previous invocation of systemd, exec()ing this one, has written out to a file. Its option argument is an open file descriptor for that process.
  • --switched-root is used to tell this invocation of systemd that it has been invoked from systemd managing an initramfs, and so should behave accordingly — including turning off some of the behaviour otherwise caused by --deserialize.
2
  • 3
    It's a good answer. To expand on this a bit: systemd running with --deserialize --switched-root essentially means systemd was also used in the initramfs. Nowadays this is pretty common, so those two options are to be expected in the command line of PID 1.
    – zbyszek
    Jun 28 '17 at 22:20
  • 1
    @zbyszek So what's the point here? If it's a good answer, why are those publicly exposed internal parts of systemd still no part in the official systemd documentation yet? Shouldn't your explanation rather be included into the official systemd documentation to explain to us what we see (systemd-cgls | grep deserialize)? It's 2020 already! Are Google and SO really the only place, where such prominently publicly presented internal parts of systemd should be explained to minors like us?
    – Tino
    Feb 22 '20 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.