summaryrefslogtreecommitdiff
path: root/net-misc/apt-cacher-ng/files/initd-r3
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/apt-cacher-ng/files/initd-r3')
-rw-r--r--net-misc/apt-cacher-ng/files/initd-r320
1 files changed, 20 insertions, 0 deletions
diff --git a/net-misc/apt-cacher-ng/files/initd-r3 b/net-misc/apt-cacher-ng/files/initd-r3
new file mode 100644
index 000000000000..665b0e46bcab
--- /dev/null
+++ b/net-misc/apt-cacher-ng/files/initd-r3
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CACHEDIR="/var/cache/${RC_SVCNAME}"
+SOCKETDIR="/run/apt-cacher-ng"
+SOCKETFILE="${SOCKETDIR}/${RC_SVCNAME}.socket"
+
+command="/usr/sbin/apt-cacher-ng"
+command_args="SocketPath=${SOCKETFILE} foreground=1 ${APT_CACHER_NG_ARGS}"
+command_background="true"
+command_user="apt-cacher-ng:apt-cacher-ng"
+pidfile="/run/${RC_SVCNAME}.pid"
+retry="15"
+
+start_pre() {
+ for d in "${SOCKETDIR}" "${CACHEDIR}"; do
+ checkpath --directory --mode 0755 --owner "${command_user}" "${d}"
+ done
+}