| # /etc/rc.d/init.d/docker |
| # description: Daemon for docker.com |
| # Required-Start: $network cgconfig |
| # Short-Description: start and stop docker |
| # Description: Daemon for docker.com |
| # Source function library. |
| pidfile="/var/run/$prog.pid" |
| lockfile="/var/lock/subsys/$prog" |
| [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog |
| if ! [ -f $pidfile ]; then |
| printf "Starting $prog:\t" |
| echo "\n$(date)\n" >> $logfile |
| "$unshare" -m -- $exec -d $other_args &>> $logfile & |
| # wait up to 10 seconds for the pidfile to exist. see |
| # https://github.com/docker/docker/issues/5359 |
| while [ ! -f $pidfile -a $tries -lt 10 ]; do |
| printf "$pidfile still exists...\n" |
| echo -n $"Stopping $prog: " |
| [ $retval -eq 0 ] && rm -f $lockfile |
| rh_status >/dev/null 2>&1 |
| if [ -f ${pidfile} ]; then |
| /bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile} |
| echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" |