Skip to content

Commit

Permalink
package/run script will recognize if we are in an lxc container to sk…
Browse files Browse the repository at this point in the history
…ip inittab configuration
  • Loading branch information
sagredo-dev committed Oct 14, 2024
1 parent dac2f90 commit 58987d6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions admin/daemontools/package/run
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 58987d6

Please sign in to comment.