Skip to content

Commit

Permalink
main: Refactor networkd/resolved fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
  • Loading branch information
monstermunchkin committed Jun 1, 2021
1 parent 3155d9e commit c9e314c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions distrobuilder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,12 @@ is_lxd_vm() {
}
## Fix functions
# fix_networkd avoids udevd issues with /sys being writable
fix_networkd() {
[ "${ID}" = "altlinux" ] || return
mkdir -p /run/systemd/system/systemd-networkd.service.d
cat <<-EOF > /run/systemd/system/systemd-networkd.service.d/lxc-ropath.conf
# fix_ro_paths avoids udevd issues with /sys and /proc being writable
fix_ro_paths() {
mkdir -p /run/systemd/system/$1.d
cat <<-EOF > /run/systemd/system/$1.d/lxc-ropath.conf
[Service]
BindReadOnlyPaths=/sys
BindReadOnlyPaths=/sys /proc
EOF
}
Expand Down Expand Up @@ -615,7 +613,10 @@ fi
# Workarounds for all containers
if is_lxc_container; then
fix_systemd_mask_audit
fix_networkd
if [ "${ID}" = "altlinux" ] || [ "${ID}" = "arch" ] || [ "${ID}" = "fedora" ]; then
fix_ro_paths systemd-networkd
fix_ro_paths systemd_resolved
fi
fi
# Workarounds for fedora/34/cloud containers
Expand Down

0 comments on commit c9e314c

Please sign in to comment.