Skip to content

Commit 4937e15

Browse files
committed
lxc.generator: Workaround issue with nsresourced
Signed-off-by: Stéphane Graber <[email protected]>
1 parent 0e1d26e commit 4937e15

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

distrobuilder/lxc.generator

+13
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ fix_ro_paths() {
4242
EOF
4343
}
4444

45+
# fix_ro_run is a workaround for units failing to write in /run due to ProtectSystem=strict
46+
fix_ro_run() {
47+
mkdir -p "/run/systemd/system/$1.d"
48+
cat <<-EOF > "/run/systemd/system/$1.d/zzz-lxc-rorun.conf"
49+
# This file was created by distrobuilder
50+
[Service]
51+
ReadWritePaths=/run
52+
EOF
53+
}
54+
4555
# fix_nm_link_state forces the network interface to a DOWN state ahead of NetworkManager starting up
4656
fix_nm_link_state() {
4757
[ -e "/sys/class/net/$1" ] || return 0
@@ -198,6 +208,9 @@ fi
198208
fix_systemd_udev_trigger
199209
fix_systemd_sysctl
200210

211+
# Fix issues with /run not being writable.
212+
fix_ro_run systemd-nsresourced.service
213+
201214
# Mask some units.
202215
fix_systemd_mask dev-hugepages.mount
203216
fix_systemd_mask run-ribchester-general.mount

0 commit comments

Comments
 (0)