summaryrefslogtreecommitdiff
blob: b43f4d924e3b5c7ecfa6e42ef572858eb575ae4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh

LOG=/var/log/monetdb/Mserver.log
echo `date` Starting MonetDB >> $LOG
/usr/bin/Mserver $@ >> $LOG 2>&1 &
MPID=$!
echo `date` Mserver started, PID: $MPID >> $LOG
rm -f ~monetdb/Mserver.pid > /dev/null
sleep 2
ALIVE=`ps --no-heading --format pid -p $MPID`
if [ $ALIVE -eq $MPID ]; then
	echo $MPID > ~monetdb/Mserver.pid
else
	echo Mserver died immediately
	exit -1
fi