aports/main/fcgiwrap/fcgiwrap.initd
Natanael Copa 462e6cb5ab 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
2018-12-24 13:01:45 +01:00

44 lines
724 B
Plaintext

#!/sbin/openrc-run
name="fcgiwrap"
description="fcgiwrap cgi daemon"
command="/usr/bin/fcgiwrap"
command_background="yes"
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} \
--background \
-u ${user} -g ${group} \
--start -- ${command_args}
eend $?
}
stop_post() {
case "$socket" in
unix:/*)
rm -f "${socket#unix:}"
;;
esac
}