aboutsummaryrefslogtreecommitdiff
path: root/rc.spawn-fcgi/fcgiwrap-srv/run
diff options
context:
space:
mode:
Diffstat (limited to 'rc.spawn-fcgi/fcgiwrap-srv/run')
-rw-r--r--rc.spawn-fcgi/fcgiwrap-srv/run24
1 files changed, 24 insertions, 0 deletions
diff --git a/rc.spawn-fcgi/fcgiwrap-srv/run b/rc.spawn-fcgi/fcgiwrap-srv/run
new file mode 100644
index 0000000..90a232b
--- /dev/null
+++ b/rc.spawn-fcgi/fcgiwrap-srv/run
@@ -0,0 +1,24 @@
+#!/bin/execlineb -P
+
+####################################################
+# Start fcgiwrap (FastCGI wrapper for CGI scripts) #
+####################################################
+
+s6-envdir env
+multisubstitute {
+ importas -u SOCKET_OWNER SOCKET_OWNER
+ importas -u SOCKET_GROUP SOCKET_GROUP
+ importas -u SOCKET_PERMS SOCKET_PERMS
+ importas -u SOCKET_PATH SOCKET_PATH
+ importas -u CMD CMD
+}
+s6-envuidgid -B ${SOCKET_OWNER}:${SOCKET_GROUP}
+multisubstitute {
+ importas -u UID UID
+ importas -u GID GID
+}
+foreground { install -dm $SOCKET_PERMS -o $UID -g $GID /run/fcgiwrap }
+s6-ipcserver-socketbinder -B -d -a $SOCKET_PERMS $SOCKET_PATH
+foreground { chown ${SOCKET_OWNER}:${SOCKET_GROUP} $SOCKET_PATH }
+s6-setuidgid ${UID}:${GID}
+exec -c $CMD