feat: get spawn init script working
This commit is contained in:
parent
649e5dff17
commit
60b179dbac
4
bin/contrib/hacky-start.rc
Executable file
4
bin/contrib/hacky-start.rc
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
## Either figure out init, or run this every time from a sudo user.
|
||||||
|
sudo rc-service nginx start
|
||||||
|
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/fcgiwrap
|
||||||
|
|
24
bin/contrib/spawn-fcgi
Executable file
24
bin/contrib/spawn-fcgi
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
## move to /etc/init.d/spawn-fcgi2
|
||||||
|
## Then sudo rc-update add spawn-fcgi2
|
||||||
|
## test with sudo rc-service spawn-fcgi2 start
|
||||||
|
## and sudo rc-service spawn-fcgi2 stop
|
||||||
|
PID_file="/var/tmp/spawn"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/fcgiwrap -P "$PID_file"
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
kill -15 "$(cat "$PID_file")"
|
||||||
|
rm "$PID_file"
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
start|stop) "$1" ;;
|
||||||
|
esac
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user