aboutsummaryrefslogtreecommitdiffstats
path: root/main/fcgiwrap/fcgiwrap.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/fcgiwrap/fcgiwrap.initd')
-rw-r--r--main/fcgiwrap/fcgiwrap.initd22
1 files changed, 19 insertions, 3 deletions
diff --git a/main/fcgiwrap/fcgiwrap.initd b/main/fcgiwrap/fcgiwrap.initd
index f5faa7dfd9..353e51f393 100644
--- a/main/fcgiwrap/fcgiwrap.initd
+++ b/main/fcgiwrap/fcgiwrap.initd
@@ -4,24 +4,40 @@ name="fcgiwrap"
description="fcgiwrap cgi daemon"
command="/usr/bin/fcgiwrap"
-command_args="-c 3 -s unix:/var/run/fcgiwrap/fcgiwrap.sock"
command_background="yes"
-pidfile="/var/run/fcgiwrap/fcgiwrap.pid"
user="fcgiwrap"
group="www-data"
+: ${socket:=unix:/run/fcgiwrap/fcgiwrap.sock}
depend() {
need net localmount
after firewall
}
+start_pre() {
+ command_args="-c ${nproc:-$(nproc)} -s $socket"
+ case "$socket" in
+ unix:/*)
+ local socket_path=${socket#unix:}
+ checkpath --directory --mode 2775 --owner ${user}:${group} \
+ ${socket_path%/*}
+ ;;
+ esac
+}
+
start() {
ebegin "Starting ${name}"
start-stop-daemon --exec ${command} \
- --pidfile ${pidfile} --make-pidfile \
--background \
-u ${user} -g ${group} \
--start -- ${command_args}
eend $?
}
+stop_post() {
+ case "$socket" in
+ unix:/*)
+ rm -f "${socket#unix:}"
+ ;;
+ esac
+}