diff --git a/contrib/init/systemd/docker.service b/contrib/init/systemd/docker.service index 83c810d13a..9738ca1ad5 100644 --- a/contrib/init/systemd/docker.service +++ b/contrib/init/systemd/docker.service @@ -6,6 +6,7 @@ Requires=docker.socket [Service] ExecStart=/usr/bin/docker -d -H fd:// +MountFlags=slave LimitNOFILE=1048576 LimitNPROC=1048576 diff --git a/contrib/init/sysvinit-redhat/docker b/contrib/init/sysvinit-redhat/docker index eadf02c75c..1994d6b31e 100755 --- a/contrib/init/sysvinit-redhat/docker +++ b/contrib/init/sysvinit-redhat/docker @@ -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" @@ -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