Explorar o código

Merge pull request #39000 from mrueg/openrc-set

openrc: Modernize and sync settings
Sebastiaan van Stijn %!s(int64=6) %!d(string=hai) anos
pai
achega
0ac8cbf747
Modificáronse 2 ficheiros con 17 adicións e 7 borrados
  1. 6 0
      contrib/init/openrc/docker.confd
  2. 11 7
      contrib/init/openrc/docker.initd

+ 6 - 0
contrib/init/openrc/docker.confd

@@ -16,6 +16,12 @@
 # where docker's pid get stored
 # where docker's pid get stored
 #DOCKER_PIDFILE="/run/docker.pid"
 #DOCKER_PIDFILE="/run/docker.pid"
 
 
+# Settings for process limits (ulimit)
+#DOCKER_ULIMIT="-c unlimited -n 1048576 -u unlimited"
+
+# seconds to wait for sending SIGTERM and SIGKILL signals when stopping docker
+#DOCKER_RETRY="TERM/60/KILL/10"
+
 # where the docker daemon itself is run from
 # where the docker daemon itself is run from
 #DOCKERD_BINARY="/usr/bin/dockerd"
 #DOCKERD_BINARY="/usr/bin/dockerd"
 
 

+ 11 - 7
contrib/init/openrc/docker.initd

@@ -11,14 +11,18 @@ DOCKER_OUTFILE="${DOCKER_OUTFILE:-${DOCKER_LOGFILE}}"
 start_stop_daemon_args="--background \
 start_stop_daemon_args="--background \
 	--stderr \"${DOCKER_ERRFILE}\" --stdout \"${DOCKER_OUTFILE}\""
 	--stderr \"${DOCKER_ERRFILE}\" --stdout \"${DOCKER_OUTFILE}\""
 
 
-start_pre() {
-	checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
+extra_started_commands="reload"
+
+rc_ulimit="${DOCKER_ULIMIT:--c unlimited -n 1048576 -u unlimited}"
 
 
-	ulimit -n 1048576
+retry="${DOCKER_RETRY:-TERM/60/KILL/10}"
 
 
-	# Having non-zero limits causes performance problems due to accounting overhead
-	# in the kernel. We recommend using cgroups to do container-local accounting.
-	ulimit -u unlimited
+start_pre() {
+	checkpath -f -m 0644 -o root:docker "$DOCKER_LOGFILE"
+}
 
 
-	return 0
+reload() {
+        ebegin "Reloading ${RC_SVCNAME}"
+        start-stop-daemon --signal HUP --pidfile "${pidfile}"
+        eend $? "Failed to stop ${RC_SVCNAME}"
 }
 }