Check for chroot dir and chroot if necessary.
This commit is contained in:
committed by
Brian O'Connor
parent
226a1dc391
commit
5413d2e5a3
@@ -33,4 +33,12 @@ if [ -d "$cgroup" ]; then
|
|||||||
cg="-g $host"
|
cg="-g $host"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec sudo mnexec -a $pid $cg $cmd
|
# Check whether host should be running in a chroot dir
|
||||||
|
rootdir="/var/run/mn/$host/root"
|
||||||
|
if [ -d $rootdir ]; then
|
||||||
|
cmd="'cd `pwd`; exec $cmd'"
|
||||||
|
cmd="chroot $rootdir bash -c $cmd"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cmd="exec sudo mnexec -a $pid $cg $cmd"
|
||||||
|
eval $cmd
|
||||||
|
|||||||
Reference in New Issue
Block a user