aboutsummaryrefslogtreecommitdiffstats
path: root/image/fcgiwrap-launcher
blob: 0970ec471656b3666fd1dfe79ae233c20f074690 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/zsh
set -eax
command="/usr/bin/fcgiwrap"
user="fcgiwrap"
group="www-data"
: ${socket:="unix:/run/fcgiwrap/fcgiwrap.sock"}
case "$socket" in
unix:/*)
  local socket_path="${socket#unix:}"
  /usr/libexec/rc/bin/checkpath --directory --mode 2775 --owner "${user}:${group}" \
    "${socket_path%/*}"
  ;;
esac

exec sudo -u "$user" -g "$group" "$command" -c "${nproc:-$(nproc)}" -s "$socket"