summaryrefslogtreecommitdiff
path: root/net-misc/apt-cacher-ng/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/apt-cacher-ng/files')
-rw-r--r--net-misc/apt-cacher-ng/files/confd-r13
-rw-r--r--net-misc/apt-cacher-ng/files/confd-r29
-rw-r--r--net-misc/apt-cacher-ng/files/initd-r234
-rw-r--r--net-misc/apt-cacher-ng/files/initd-r320
4 files changed, 29 insertions, 37 deletions
diff --git a/net-misc/apt-cacher-ng/files/confd-r1 b/net-misc/apt-cacher-ng/files/confd-r1
deleted file mode 100644
index 84b659bc488b..000000000000
--- a/net-misc/apt-cacher-ng/files/confd-r1
+++ /dev/null
@@ -1,3 +0,0 @@
-# Additional options that are passed to the Daemon.
-DAEMON_OPTS=" -c /etc/apt-cacher-ng "
-LOGDIR=""
diff --git a/net-misc/apt-cacher-ng/files/confd-r2 b/net-misc/apt-cacher-ng/files/confd-r2
new file mode 100644
index 000000000000..2e2f5c99dd4a
--- /dev/null
+++ b/net-misc/apt-cacher-ng/files/confd-r2
@@ -0,0 +1,9 @@
+# Additional options that are passed to the Daemon.
+APT_CACHER_NG_ARGS="-c /etc/apt-cacher-ng"
+
+# Specify the network services that correspond to the "BindAddress"
+# setting in your apt-cacher-ng.conf. For example, if you bind to
+# 127.0.0.1, then this should be set to "net.lo" which provides the
+# loopback interface. The default BindAddress listens on all available
+# interfaces, for which it suffices to have only one (net.lo) up.
+rc_need="net.lo"
diff --git a/net-misc/apt-cacher-ng/files/initd-r2 b/net-misc/apt-cacher-ng/files/initd-r2
deleted file mode 100644
index ae9ab7258cc4..000000000000
--- a/net-misc/apt-cacher-ng/files/initd-r2
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-CACHEDIR="var/cache/${RC_SVCNAME}"
-DAEMON="/usr/sbin/${RC_SVCNAME}"
-RUNDIR="/var/run/${RC_SVCNAME}"
-PIDFILE="${RUNDIR}/${RC_SVCNAME}.pid"
-SOCKETFILE="${RUNDIR}/${RC_SVCNAME}.socket"
-DAEMON_OPTS="${DAEMON_OPTS} pidfile=${PIDFILE} SocketPath=${SOCKETFILE} foreground=0"
-
-depend() {
- use net
-}
-
-start() {
- ebegin "Starting ${RC_SVCNAME}"
- checkpath -d -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "${RUNDIR}"
- checkpath -d -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "${CACHEDIR}"
- [ -z "${LOGDIR}" ] && checkpath -d -m 0755 -o ${RC_SVCNAME}:${RC_SVCNAME} "/var/log/${RC_SVCNAME}"
- start-stop-daemon --start --exec ${DAEMON} \
- --user ${RC_SVCNAME} --group ${RC_SVCNAME} \
- --pidfile ${PIDFILE} \
- -- ${DAEMON_OPTS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping ${RC_SVCNAME}"
- start-stop-daemon --stop --retry 15 --exec ${DAEMON} \
- --pidfile ${PIDFILE}
- rm -f ${PIDFILE}
- eend $?
-}
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
+}