From 462e6cb5abd260325308de5d8c55ed1801058a9e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 24 Dec 2018 12:22:54 +0100 Subject: 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 --- main/fcgiwrap/fcgiwrap.initd | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'main/fcgiwrap/fcgiwrap.initd') 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 +} -- cgit v1.2.3