Skip to content

Instantly share code, notes, and snippets.

@richard24se
Last active February 9, 2022 15:16
Show Gist options
  • Save richard24se/c41d7edde19ccb87ef8d1083822d4e26 to your computer and use it in GitHub Desktop.
Save richard24se/c41d7edde19ccb87ef8d1083822d4e26 to your computer and use it in GitHub Desktop.
BASE=docker
# modify these in /etc/default/$BASE (/etc/default/docker)
DOCKERD=/usr/bin/dockerd
# This is the pid file managed by docker itself
DOCKER_PIDFILE=/var/run/$BASE.pid
# This is the pid file created/managed by start-stop-daemon
DOCKER_SSD_PIDFILE=/var/run/$BASE-ssd.pid
DOCKER_LOGFILE=/var/log/$BASE.log
DOCKER_OPTS=
DOCKER_DESC="Docker"|
if ! pgrep "dockerd" > /dev/null
then
echo "starting docker..."
sudo start-stop-daemon --start --background \
--exec "$DOCKERD" \
--pidfile "$DOCKER_SSD_PIDFILE" \
--make-pidfile \
-- \
-p "$DOCKER_PIDFILE" \
$DOCKER_OPTS \
#>> "$DOCKER_LOGFILE" 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment