view rlgwebd @ 160:ed837da65e5f

RLGWebD: Clean up code related to session timestamps. TermSessions now store the timestamp of the latest data. This removes the need to use fstat() to calculate idle times. The reaper() function is removed. It may be useful to find another way to remove old login keys.
author John "Elwin" Edwards
date Sat, 03 Jan 2015 17:39:15 -0500
parents 1a156a7746a7
children 5483d413a45b
line wrap: on
line source

#!/bin/sh

NODE_PATH=/usr/lib/node_modules
LOGFILE=/var/local/rlgwebd/log
CTLSOCKET=/var/local/rlgwebd/ctl
RLGWEBDJS=./rlgwebd.js

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