mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-10 02:11:44 +01:00
currently main/fcgiwrap hard-codes the user and group it runs as in /etc/init.d/fcgiwrap. this commit tweaks the init and conf files so that it is possible to run fcgiwrap as a custom user and group.
46 lines
745 B
Bash
46 lines
745 B
Bash
#!/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 \
|
|
-k 0002 \
|
|
-u ${user} -g ${group} \
|
|
--start -- ${command_args}
|
|
eend $?
|
|
}
|
|
|
|
stop_post() {
|
|
case "$socket" in
|
|
unix:/*)
|
|
rm -f "${socket#unix:}"
|
|
;;
|
|
esac
|
|
}
|