commit 01e571a21b9ab36e873d962c35bfe71c4d448a07 parent 0ad44f3a41fcf28f59ceb6ba293d9ff5901ea744 Author: NunoSempere <nuno.sempere@protonmail.com> Date: Thu, 10 Mar 2022 22:53:39 +0000 feat: add spawn fcgi needed by systemd I known, I know, I'm moving to alpine linux. Diffstat:
| M | .gitignore | | | 3 | ++- |
| A | bin/spawn-fcgi.sh | | | 16 | ++++++++++++++++ |
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore @@ -13,4 +13,5 @@ !/sites/CREATE-SITE-DIRECTORIES-HERE - +## pid artifact files +**/pid diff --git a/bin/spawn-fcgi.sh b/bin/spawn-fcgi.sh @@ -0,0 +1,16 @@ +#!/usr/bin/bash +PID_file="/home/uriel/workspace/werc-1.5.0/bin/pid" +start() { + PID_spawn="$(/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/sbin/fcgiwrap)" + echo "$PID_spawn" > "$PID_file" +} + +stop() { + kill -15 "$(cat "$PID_FILE")" +} + +case $1 in + start|stop) "$1" ;; +esac + +