summaryrefslogtreecommitdiffstats
path: root/utils/daemon.sh
blob: ab1d24f9ce78c0c7a634c1b2fe25b6de077585e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

LOCK=$JUDGE_PREFIX/judge.pid	#FIXME

if [ -e $LOCK ]
then
	PID=`cat $LOCK`

	if ps $PID >/dev/null
	then
		echo "Daemon is already running and it's PID is $PID." >&2
		exit 1
	else
		rm -f $LOCK
	fi
fi

sh $JUDGE_PREFIX/base/daemon.sh &>> $JUDGE_PREFIX/log/error.log &