docker.initd 832 B

123456789101112131415161718192021222324
  1. #!/sbin/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. start_pre() {
  13. checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
  14. ulimit -n 1048576
  15. # Having non-zero limits causes performance problems due to accounting overhead
  16. # in the kernel. We recommend using cgroups to do container-local accounting.
  17. ulimit -u unlimited
  18. return 0
  19. }