Skip to content

Commit

Permalink
lxc.generator: Workaround issue with nsresourced
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Dec 11, 2024
1 parent 0e1d26e commit 4937e15
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions distrobuilder/lxc.generator
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ fix_ro_paths() {
EOF
}

# fix_ro_run is a workaround for units failing to write in /run due to ProtectSystem=strict
fix_ro_run() {
mkdir -p "/run/systemd/system/$1.d"
cat <<-EOF > "/run/systemd/system/$1.d/zzz-lxc-rorun.conf"
# This file was created by distrobuilder
[Service]
ReadWritePaths=/run
EOF
}

# fix_nm_link_state forces the network interface to a DOWN state ahead of NetworkManager starting up
fix_nm_link_state() {
[ -e "/sys/class/net/$1" ] || return 0
Expand Down Expand Up @@ -198,6 +208,9 @@ fi
fix_systemd_udev_trigger
fix_systemd_sysctl

# Fix issues with /run not being writable.
fix_ro_run systemd-nsresourced.service

# Mask some units.
fix_systemd_mask dev-hugepages.mount
fix_systemd_mask run-ribchester-general.mount
Expand Down

0 comments on commit 4937e15

Please sign in to comment.