Compare commits
4 Commits
ab1b472062
...
1d086a6e59
Author | SHA1 | Date |
---|---|---|
Jun'ichi Nomura | 1d086a6e59 | |
Lennart Poettering | 9dca1d5723 | |
Zbigniew Jędrzejewski-Szmek | 744c49e1fe | |
Zbigniew Jędrzejewski-Szmek | 0a5a8f13b4 |
|
@ -19,7 +19,7 @@ interfaces are currently used by dracut and the ArchLinux initrds.
|
|||
|
||||
* The initrd should mount `/run/` as a tmpfs and pass it pre-mounted when
|
||||
jumping into the main system when executing systemd. The mount options should
|
||||
be `mode=755,nodev,nosuid,strictatime`
|
||||
be `mode=755,nodev,nosuid,strictatime`.
|
||||
|
||||
* It's highly recommended that the initrd also mounts `/usr/` (if split off) as
|
||||
appropriate and passes it pre-mounted to the main system, to avoid the
|
||||
|
|
|
@ -155,6 +155,8 @@ without communicating with the `systemd` process:
|
|||
Many other programs support operation without the system manager except when
|
||||
the specific functionality requires such communication. For example
|
||||
`journalctl` operates almost independently, but will query the boot id when
|
||||
`--boot` option is used. `systemd-journal-remote`, `systemd-journal-upload`,
|
||||
`systemd-journal-gatewayd`, `coredumpctl`, `busctl`, `systemctl --root` also
|
||||
fall into this category.
|
||||
`--boot` option is used; it also requires `systemd-journald` (and thus
|
||||
`systemd`) to be running for options like `--flush` and `--sync`.
|
||||
`systemd-journal-remote`, `systemd-journal-upload`, `systemd-journal-gatewayd`,
|
||||
`coredumpctl`, `busctl`, `systemctl --root` also fall into this category of
|
||||
mostly-independent programs.
|
||||
|
|
|
@ -90,9 +90,9 @@ kernel threads are excluded too. Thus, a daemon which wants to take advantage
|
|||
of this logic needs to place the following at the top of its main() function:
|
||||
|
||||
```c
|
||||
…
|
||||
...
|
||||
[0][0] = '@';
|
||||
…
|
||||
...
|
||||
```
|
||||
|
||||
And that's already it. Note that this functionality is only to be used by
|
||||
|
@ -116,10 +116,10 @@ otherwise doesn't. Something like this:
|
|||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
…
|
||||
...
|
||||
if (access("/etc/initrd-release", F_OK) >= 0)
|
||||
argv[0][0] = '@';
|
||||
…
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -190,4 +190,4 @@ few additional notes for supporting these setups:
|
|||
program consult this blog story: [Socket
|
||||
Activation](http://0pointer.de/blog/projects/socket-activation.html)
|
||||
|
||||
* Consider having a look at the [initrd Interface of systemd](http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface)
|
||||
* Consider having a look at the [initrd Interface of systemd](https://systemd.io/INITRD_INTERFACE/).
|
||||
|
|
|
@ -1568,7 +1568,7 @@ static int mount_setup_existing_unit(
|
|||
if (r > 0)
|
||||
flags |= MOUNT_PROC_JUST_CHANGED;
|
||||
|
||||
if (!MOUNT(u)->from_proc_self_mountinfo || FLAGS_SET(MOUNT(u)->proc_flags, MOUNT_PROC_JUST_MOUNTED))
|
||||
if (!MOUNT(u)->from_proc_self_mountinfo || FLAGS_SET(MOUNT(u)->proc_flags, MOUNT_PROC_JUST_MOUNTED) || MOUNT(u)->state == MOUNT_MOUNTING)
|
||||
flags |= MOUNT_PROC_JUST_MOUNTED;
|
||||
|
||||
MOUNT(u)->from_proc_self_mountinfo = true;
|
||||
|
|
Loading…
Reference in New Issue