Modules are now expected to be in /var/local/lib/node_modules. This is intended to make it easier to avoid running npm as root.
25 lines
396 B
Bash
25 lines
396 B
Bash
#!/bin/sh
|
|
|
|
NODE_PATH=/var/local/lib/node_modules
|
|
LOGFILE=/var/log/rlgwebd.log
|
|
CTLSOCKET=/var/run/rlgwebd/rlgwebd.sock
|
|
RLGWEBDJS=/usr/local/bin/rlgwebd
|
|
|
|
export NODE_PATH
|
|
|
|
if [ $UID != 0 ]
|
|
then
|
|
echo "$0 needs to run as root." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ $# -gt 0 ] && [ $1 = stop ]
|
|
then
|
|
socat "EXEC:echo quit" "$CTLSOCKET"
|
|
else
|
|
# Start
|
|
setsid node "$RLGWEBDJS" </dev/null &>>$LOGFILE &
|
|
fi
|
|
|
|
exit
|
|
|