Last active
October 20, 2015 19:33
-
-
Save dkuppitz/20bda51e3465a612cd9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!upstart | |
description "Gremlin Server" | |
env GREMLIN_USER=ubuntu | |
env GREMLIN_GROUP=ubuntu | |
env GREMLIN_PID_FILE=/var/run/gremlin.pid | |
env GREMLIN_HOME=/usr/local/gremlin-server-3.0.0.M5 | |
env GREMLIN_LOG=/var/log/gremlin/gremlin-server.log | |
# uncomment the next line if you want Gremlin Server to start automatically after system reboots | |
#start on filesystem and net-device-up IFACE=eth0 | |
stop on [016] | |
respawn | |
pre-start script | |
LOG_DIR=`dirname $GREMLIN_LOG` | |
if [ ! -d $LOG_DIR ]; then | |
mkdir -p $LOG_DIR | |
chown -R $GREMLIN_USER:$GREMLIN_GROUP $LOG_DIR | |
fi | |
end script | |
script | |
if [ -f /etc/default/gremlin-server ]; then . /etc/default/gremlin-server; fi | |
exec start-stop-daemon --start --make-pidfile --pidfile $GREMLIN_PID_FILE --chuid $GREMLIN_USER --chdir $GREMLIN_HOME --exec $GREMLIN_HOME/bin/gremlin-server.sh >> $GREMLIN_LOG 2>&1 | |
end script | |
post-stop script | |
rm -f $GREMLIN_PID_FILE | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Store this file in
/etc/init
, adjust the environment variables (GREMLIN_USER
,GREMLIN_GROUP
, etc.), then start/stop the Gremlin Server using: