Skip to content

Commit

Permalink
contrib/sysvinit-redhat: unshare mount namespace
Browse files Browse the repository at this point in the history
unshare the mount namespace of the docker daemon to avoid other pids
outside the daemon holding mount references of docker containers.

Signed-off-by: Vincent Batts <[email protected]>
  • Loading branch information
vbatts committed Jan 20, 2015
1 parent eb76cb2 commit 6bb6586
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/init/sysvinit-redhat/docker
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
. /etc/rc.d/init.d/functions

prog="docker"
unshare=/usr/bin/unshare
exec="/usr/bin/$prog"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
Expand All @@ -46,7 +47,7 @@ start() {
prestart
printf "Starting $prog:\t"
echo "\n$(date)\n" >> $logfile
$exec -d $other_args &>> $logfile &
"$unshare" -m -- $exec -d $other_args &>> $logfile &
pid=$!
touch $lockfile
# wait up to 10 seconds for the pidfile to exist. see
Expand Down

0 comments on commit 6bb6586

Please sign in to comment.