Mercurial > hg > rlgwebd
annotate initscript @ 213:08665c56c6a0 default tip
Fix race condition related to watching DGL games.
It's possible for a dgamelaunch game to end and cause rlgwebd to stop watching
it before rlgwebd has started watching it.
author | John "Elwin" Edwards |
---|---|
date | Sun, 16 Aug 2020 20:56:18 -0400 |
parents | 2667aaad8e08 |
children |
rev | line source |
---|---|
139 | 1 #!/bin/sh |
2 | |
209 | 3 NODE_PATH=/var/local/lib/node_modules |
195 | 4 LOGFILE=/var/log/rlgwebd.log |
208
f06f2d1a5035
Fix possibly insecure permissions on the control socket.
John "Elwin" Edwards
parents:
196
diff
changeset
|
5 CTLSOCKET=/var/run/rlgwebd/rlgwebd.sock |
196
298a531776d6
Add an uninstall target to the Makefile.
John "Elwin" Edwards
parents:
195
diff
changeset
|
6 RLGWEBDJS=/usr/local/bin/rlgwebd |
139 | 7 |
141
1a156a7746a7
RLGWebD: use NODE_PATH to find modules.
John "Elwin" Edwards
parents:
139
diff
changeset
|
8 export NODE_PATH |
1a156a7746a7
RLGWebD: use NODE_PATH to find modules.
John "Elwin" Edwards
parents:
139
diff
changeset
|
9 |
139 | 10 if [ $UID != 0 ] |
11 then | |
12 echo "$0 needs to run as root." >&2 | |
13 exit 1 | |
14 fi | |
15 | |
16 if [ $# -gt 0 ] && [ $1 = stop ] | |
17 then | |
18 socat "EXEC:echo quit" "$CTLSOCKET" | |
19 else | |
20 # Start | |
21 setsid node "$RLGWEBDJS" </dev/null &>>$LOGFILE & | |
22 fi | |
23 | |
24 exit | |
25 |