aboutsummaryrefslogtreecommitdiffstats
path: root/main/fcgiwrap/fcgiwrap.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-12-24 12:22:54 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2018-12-24 13:01:45 +0100
commit462e6cb5abd260325308de5d8c55ed1801058a9e (patch)
tree720806f595ef7e039c37420e30b665877dd51bbf /main/fcgiwrap/fcgiwrap.initd
parent0722927b11cd68409d75a6cf425743843150ce32 (diff)
downloadaports-462e6cb5abd260325308de5d8c55ed1801058a9e.tar.bz2
aports-462e6cb5abd260325308de5d8c55ed1801058a9e.tar.xz
main/fcgiwrap: fix init.d script and claim maintainership
- split openrc subpackage - use /run instead of /var/run for socket dir - remove use of pidfile. It seems that the first process will not clean up the childen. Let openrc kill all children by not specify pidfile - fix permission of unix socket path. it needs to be writable by www-data group. - clean up unix socket after stop - make it possible to set number of preforks via 'nproc' in /etc/conf.d/fcgiwrap. default to number of cpus on system. - allow set tcp socket via /etc/conf.d/fcgiwrap - provide example /etc/conf.d/fcgiwrap
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
+}