docker.initd 908 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/openrc-run
  2. # Copyright 1999-2013 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. command="${DOCKERD_BINARY:-/usr/bin/dockerd}"
  5. pidfile="${DOCKER_PIDFILE:-/run/${RC_SVCNAME}.pid}"
  6. command_args="-p \"${pidfile}\" ${DOCKER_OPTS}"
  7. DOCKER_LOGFILE="${DOCKER_LOGFILE:-/var/log/${RC_SVCNAME}.log}"
  8. DOCKER_ERRFILE="${DOCKER_ERRFILE:-${DOCKER_LOGFILE}}"
  9. DOCKER_OUTFILE="${DOCKER_OUTFILE:-${DOCKER_LOGFILE}}"
  10. start_stop_daemon_args="--background \
  11. --stderr \"${DOCKER_ERRFILE}\" --stdout \"${DOCKER_OUTFILE}\""
  12. extra_started_commands="reload"
  13. rc_ulimit="${DOCKER_ULIMIT:--c unlimited -n 1048576 -u unlimited}"
  14. retry="${DOCKER_RETRY:-TERM/60/KILL/10}"
  15. start_pre() {
  16. checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
  17. }
  18. reload() {
  19. ebegin "Reloading ${RC_SVCNAME}"
  20. start-stop-daemon --signal HUP --pidfile "${pidfile}"
  21. eend $? "Failed to stop ${RC_SVCNAME}"
  22. }