Skip to content

Instantly share code, notes, and snippets.

@jkschneider
Last active June 16, 2017 23:04
Show Gist options
  • Save jkschneider/3d8594e1dd8d78ae3e5cb63089cd72d1 to your computer and use it in GitHub Desktop.
Save jkschneider/3d8594e1dd8d78ae3e5cb63089cd72d1 to your computer and use it in GitHub Desktop.
Initialization actions for Netflix Atlas on a Google Cloud Dataproc master
#!/bin/sh
#
# /etc/init.d/mysystem
# Subsystem file for "Atlas" server
#
# chkconfig: 2345 95 05 (1)
# description: Atlas server daemon
ATLAS_VERSION=1.5.3
RETVAL=0
prog="atlas"
mkdir -p /opt/atlas
sudo curl -Lo /opt/atlas/memory.conf https://raw.githubusercontent.com/Netflix/atlas/v1.5.x/conf/memory.conf
sudo curl -Lo /opt/atlas/atlas-$ATLAS_VERSION-standalone.jar https://github.com/Netflix/atlas/releases/download/v$ATLAS_VERSION/atlas-$ATLAS_VERSION-standalone.jar
start() {
echo -n $"Starting $prog:"
nohup java -jar /opt/atlas/atlas-$ATLAS_VERSION-standalone.jar /opt/atlas/memory.conf > /dev/null 2>&1&
RETVAL=$?
echo
}
stop() {
echo -n $"Stopping $prog:"
killproc $prog -TERM
RETVAL=$?
echo
}
reload() { (8)
echo -n $"Reloading $prog:"
killproc $prog -HUP
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
condrestart)
if [ -f /var/lock/subsys/$prog ] ; then
stop
# avoid race
sleep 3
start
fi
;;
status)
status $prog
RETVAL=$?
;;
*) (10)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
RETVAL=1
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment