aboutsummaryrefslogtreecommitdiffstats
path: root/main/tinyproxy/tinyproxy.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/tinyproxy/tinyproxy.initd')
-rw-r--r--main/tinyproxy/tinyproxy.initd36
1 files changed, 11 insertions, 25 deletions
diff --git a/main/tinyproxy/tinyproxy.initd b/main/tinyproxy/tinyproxy.initd
index 48688a2c19..dc8d3cc5f3 100644
--- a/main/tinyproxy/tinyproxy.initd
+++ b/main/tinyproxy/tinyproxy.initd
@@ -2,39 +2,25 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-get_config() {
- res=$(awk '$1 == "'$1'" { s=$2 } END { print s }' "$CONFFILE")
-
- if [ "x$res" = "x" ]; then
- echo "$2"
- else
- eval echo "$res"
- fi
-}
-
: ${CONFFILE:="/etc/${SVCNAME}/${SVCNAME}.conf"}
command=/usr/bin/tinyproxy
-command_args="-c ${CONFFILE}"
-pidfile=$(get_config PidFile /run/tinyproxy/${SVCNAME}.pid)
+command_args="-d -c ${CONFFILE}"
+command_user="tinyproxy:tinyproxy"
+command_background="true"
+
+pidfile=/run/${SVCNAME}.pid
+output_log=/var/log/tinyproxy/${SVCNAME}.log
depend() {
config "$CONFFILE"
-
use dns
-
- [ "$(get_config Syslog Off)" = "On" ] && \
- use logger
}
-start_pre() {
- piddir=$(dirname ${pidfile})
+extra_started_commands="reload"
+reload() {
+ ebegin "Reloading ${SVCNAME}"
- if [ "${piddir}" = "/run" ]; then
- eerror "Please change your PidFile settings to be within the"
- eerror "/run/tinyproxy directory"
- eend 1
- else
- checkpath -d -o $(get_config User tinyproxy):$(get_config Group tinyproxy) ${piddir}
- fi
+ start-stop-daemon --signal SIGUSR1 \
+ --exec "${command}" --pidfile "${pidfile}"
}