Skip to content

Instantly share code, notes, and snippets.

@conikeec
Forked from stucchio/run-elephant.sh
Created June 24, 2011 18:18
Show Gist options
  • Save conikeec/1045350 to your computer and use it in GitHub Desktop.
Save conikeec/1045350 to your computer and use it in GitHub Desktop.
A script to run elephantdb as a daemon
#!/bin/sh
if test -s /var/run/hadoop/elephantdb.pid;
then
OLDPID=`cat /var/run/hadoop/elephantdb.pid`
echo "Killing old elephant process, pid=$OLDPID"
kill $OLDPID
rm /var/run/hadoop/elephantdb.pid
fi;
nohup java elephantdb.main /elephant/global-conf.clj /usr/local/hadoop/conf/elephantdb-local-conf.clj "`date`" > /var/log/hadoop/elephantdb.log &
echo $! > /var/run/hadoop/elephantdb.pid
echo "Started elephantdb, pid=$!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment