Skip to content
Snippets Groups Projects
Commit 5413d2e5 authored by Bob Lantz's avatar Bob Lantz Committed by Brian O'Connor
Browse files

Check for chroot dir and chroot if necessary.

parent 226a1dc3
No related branches found
No related tags found
No related merge requests found
......@@ -33,4 +33,12 @@ if [ -d "$cgroup" ]; then
cg="-g $host"
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment