Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remount sysfs as RW during boot time
See the comment in the unit file for more information. Signed-off-by: gbenhaim <galbh2@gmail.com>
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[Unit] | ||
Description=Remount sysfs as RW | ||
Before=local-fs.target | ||
DefaultDependencies=no | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/mount -t sysfs -o remount,rw,nosuid,nodev,noexec,relatime,seclabel sysfs /sys | ||
|
||
[Install] | ||
WantedBy=local-fs.target | ||
|
||
|
||
# When running the container in Openshift "sysfs" is mounted "ro", | ||
# which disallow Libvirt to create networks. | ||
# | ||
# Bind mount "/sys" from the host isn't recommended, since objects under | ||
# "/sys/class/net", which aren't part of the container network namespace | ||
# are visible. | ||
# | ||
# Mount unit can't be used (hence /etc/fstab can't be used also), since | ||
# systemd refuses to create it if the mount point is "/sys". | ||
# For more info: | ||
# - https://github.com/systemd/systemd/blob/master/src/core/mount.c#L1581 | ||
# - https://github.com/systemd/systemd/blob/0c17c0043383f31170b8e3c1abd491f9e03c8ec7/src/core/mount-setup.c#L121 | ||
# - https://github.com/systemd/systemd/blob/0c17c0043383f31170b8e3c1abd491f9e03c8ec7/src/core/mount-setup.c#L61 | ||
# | ||
# Using "local-fs.target" will ensure that the remount is executed before | ||
# any service that is "WantedBy" multi-user.target. | ||
# | ||
# "DefaultDependencies=no" is required in order to avoid ordering cycle | ||
# (see systemd,service(5) for more info). |