From 58987d680bfa7c4e5746f63b0f086513311629c7 Mon Sep 17 00:00:00 2001 From: sagredo-dev Date: Mon, 14 Oct 2024 19:41:43 +0200 Subject: [PATCH] package/run script will recognize if we are in an lxc container to skip inittab configuration --- admin/daemontools/package/run | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/admin/daemontools/package/run b/admin/daemontools/package/run index bf01089..08ffa56 100755 --- a/admin/daemontools/package/run +++ b/admin/daemontools/package/run @@ -13,9 +13,21 @@ fi echo 'Creating /service...' mkdir /service -if test -r /etc/inittab +# If we are in an lxc container, set $container to skip inittab configuration +if grep -aq container=lxc /proc/1/environ 2> /dev/null +then + container="lxc" +fi + +if [ -r /etc/inittab ] && [ -z $container ] then /command/setlock /etc/inittab package/run.inittab else - /command/setlock /etc/rc.local package/run.rclocal + if [ -w /etc/rc.d/rc.local ] + then + rclocal=/etc/rc.d/rc.local + else + rclocal=/etc/rc.local + fi + /command/setlock $rclocal package/run.rclocal $rclocal fi