Skip to content

Instantly share code, notes, and snippets.

@stucchio
Created April 4, 2011 18:14
Show Gist options
  • Save stucchio/902108 to your computer and use it in GitHub Desktop.
Save stucchio/902108 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