systemd --switched-root --deserialize 参数说明

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了systemd --switched-root --deserialize 参数说明相关的知识,希望对你有一定的参考价值。

systemd --switched-root --deserialize的这两个参数是内部用的,用于源代码中,不对外提供接口。


详见:

https://lists.freedesktop.org/archives/systemd-devel/2013-September/013008.html


关于这两个参数的解释可见:

https://unix.stackexchange.com/questions/98128/what-are-the-systemd-command-line-options-switched-root-and-deserialize


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

  • --deserialize is used to restore saved internal state that a previous invocation of systemdexec()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.

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. 

本文出自 “敏而好学” 博客,谢绝转载!

以上是关于systemd --switched-root --deserialize 参数说明的主要内容,如果未能解决你的问题,请参考以下文章

systemd 和 init

systemd --user 配置

systemd --user 配置

systemd 详解

systemd 为啥会有那么大的争议?

systemd 和 如何修改和创建一个 systemd service (Understanding and administering systemd)