mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
tree-wide: update "that that"
This commit is contained in:
parent
10f3484950
commit
273d76f4f8
|
@ -77,7 +77,7 @@ manager, please consider supporting the following interfaces.
|
||||||
container instance) or creating one scope unit for each container instance
|
container instance) or creating one scope unit for each container instance
|
||||||
via systemd's transient unit API (in case you have one container manager
|
via systemd's transient unit API (in case you have one container manager
|
||||||
that manages all instances. Either way, make sure to set `Delegate=yes` in
|
that manages all instances. Either way, make sure to set `Delegate=yes` in
|
||||||
it. This ensures that that the unit you created will be part of all cgroup
|
it. This ensures that the unit you created will be part of all cgroup
|
||||||
controllers (or at least the ones systemd understands). The latter may also
|
controllers (or at least the ones systemd understands). The latter may also
|
||||||
be done via `systemd-machined`'s `CreateMachine()` API. Make sure to use the
|
be done via `systemd-machined`'s `CreateMachine()` API. Make sure to use the
|
||||||
cgroup path systemd put your process in for all operations of the container.
|
cgroup path systemd put your process in for all operations of the container.
|
||||||
|
@ -364,7 +364,7 @@ If you write software that wants to detect whether it is run in a container,
|
||||||
please check `/proc/1/environ` and look for the `container=` environment
|
please check `/proc/1/environ` and look for the `container=` environment
|
||||||
variable. Do not assume the environment variable is inherited down the process
|
variable. Do not assume the environment variable is inherited down the process
|
||||||
tree. It generally is not. Hence check the environment block of PID 1, not your
|
tree. It generally is not. Hence check the environment block of PID 1, not your
|
||||||
own. Note though that that file is only accessible to root. systemd hence early
|
own. Note though that this file is only accessible to root. systemd hence early
|
||||||
on also copies the value into `/run/systemd/container`, which is readable for
|
on also copies the value into `/run/systemd/container`, which is readable for
|
||||||
everybody. However, that's a systemd-specific interface and other init systems
|
everybody. However, that's a systemd-specific interface and other init systems
|
||||||
are unlikely to do the same.
|
are unlikely to do the same.
|
||||||
|
|
|
@ -1103,7 +1103,7 @@ int copy_file_atomic_full(
|
||||||
assert(from);
|
assert(from);
|
||||||
assert(to);
|
assert(to);
|
||||||
|
|
||||||
/* We try to use O_TMPFILE here to create the file if we can. Note that that only works if COPY_REPLACE is not
|
/* We try to use O_TMPFILE here to create the file if we can. Note that this only works if COPY_REPLACE is not
|
||||||
* set though as we need to use linkat() for linking the O_TMPFILE file into the file system but that system
|
* set though as we need to use linkat() for linking the O_TMPFILE file into the file system but that system
|
||||||
* call can't replace existing files. Hence, if COPY_REPLACE is set we create a temporary name in the file
|
* call can't replace existing files. Hence, if COPY_REPLACE is set we create a temporary name in the file
|
||||||
* system right-away and unconditionally which we then can renameat() to the right name after we completed
|
* system right-away and unconditionally which we then can renameat() to the right name after we completed
|
||||||
|
|
|
@ -232,7 +232,7 @@ static int loop_configure(
|
||||||
* ioctl can return EAGAIN in case we change the lo_offset field, if someone else is accessing the
|
* ioctl can return EAGAIN in case we change the lo_offset field, if someone else is accessing the
|
||||||
* block device while we try to reconfigure it. This is a pretty common case, since udev might
|
* block device while we try to reconfigure it. This is a pretty common case, since udev might
|
||||||
* instantly start probing the device as soon as we attach an fd to it. Hence handle it in two ways:
|
* instantly start probing the device as soon as we attach an fd to it. Hence handle it in two ways:
|
||||||
* first, let's take the BSD lock that that ensures that udev will not step in between the point in
|
* first, let's take the BSD lock to ensure that udev will not step in between the point in
|
||||||
* time where we attach the fd and where we reconfigure the device. Secondly, let's wait 50ms on
|
* time where we attach the fd and where we reconfigure the device. Secondly, let's wait 50ms on
|
||||||
* EAGAIN and retry. The former should be an efficient mechanism to avoid we have to wait 50ms
|
* EAGAIN and retry. The former should be an efficient mechanism to avoid we have to wait 50ms
|
||||||
* needlessly if we are just racing against udev. The latter is protection against all other cases,
|
* needlessly if we are just racing against udev. The latter is protection against all other cases,
|
||||||
|
|
|
@ -232,8 +232,8 @@ static void sync_with_progress(void) {
|
||||||
|
|
||||||
BLOCK_SIGNALS(SIGCHLD);
|
BLOCK_SIGNALS(SIGCHLD);
|
||||||
|
|
||||||
/* Due to the possibility of the sync operation hanging, we fork a child process and monitor the progress. If
|
/* Due to the possibility of the sync operation hanging, we fork a child process and monitor
|
||||||
* the timeout lapses, the assumption is that that particular sync stalled. */
|
* the progress. If the timeout lapses, the assumption is that the particular sync stalled. */
|
||||||
|
|
||||||
r = asynchronous_sync(&pid);
|
r = asynchronous_sync(&pid);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
|
|
@ -514,10 +514,8 @@ static int remount_with_timeout(MountPoint *m, int umount_log_level) {
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
/* Due to the possibility of a remount operation hanging, we
|
/* Due to the possibility of a remount operation hanging, we fork a child process and set a
|
||||||
* fork a child process and set a timeout. If the timeout
|
* timeout. If the timeout lapses, the assumption is that the particular remount failed. */
|
||||||
* lapses, the assumption is that that particular remount
|
|
||||||
* failed. */
|
|
||||||
r = safe_fork("(sd-remount)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_LOG|FORK_REOPEN_LOG, &pid);
|
r = safe_fork("(sd-remount)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_LOG|FORK_REOPEN_LOG, &pid);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
@ -552,10 +550,8 @@ static int umount_with_timeout(MountPoint *m, int umount_log_level) {
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
/* Due to the possibility of a umount operation hanging, we
|
/* Due to the possibility of a umount operation hanging, we fork a child process and set a
|
||||||
* fork a child process and set a timeout. If the timeout
|
* timeout. If the timeout lapses, the assumption is that the particular umount failed. */
|
||||||
* lapses, the assumption is that that particular umount
|
|
||||||
* failed. */
|
|
||||||
r = safe_fork("(sd-umount)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_LOG|FORK_REOPEN_LOG, &pid);
|
r = safe_fork("(sd-umount)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_LOG|FORK_REOPEN_LOG, &pid);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in a new issue