Skip to content

Instantly share code, notes, and snippets.

@JasonGiedymin
Forked from kwilczynski/Mesos upstart scripts
Last active December 29, 2015 19:49
Show Gist options
  • Save JasonGiedymin/7719777 to your computer and use it in GitHub Desktop.
Save JasonGiedymin/7719777 to your computer and use it in GitHub Desktop.
Updating with mesos trunk: - Change log location - Change mesos home (temporary)
description "Mesos Master"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
respawn
respawn limit 2 5
env MESOS_CONFIG="/etc/mesos/conf"
env MESOS_HOME="/usr/local/lib"
env MESOS_LOG_FILE="/var/log/mesos/mesos-master.log"
umask 007
kill timeout 300
pre-start script
[ -r $MESOS_CONFIG ]
end script
limit nofile 32768 32768
script
exec > $MESOS_LOG_FILE 2>&1
MESOS_MASTER_ENABLED="no"
[ -e "/etc/default/mesos" ] && . "/etc/default/mesos"
if [ "x$MESOS_MASTER_ENABLED" = "xyes" ]; then
if [ -e /usr/sbin/mesos-detect-java.sh ]; then
. /usr/sbin/mesos-detect-java.sh
fi
export JAVA_HOME LD_LIBRARY_PATH
exec /usr/sbin/mesos-master --conf=${MESOS_CONFIG}
fi
end script
description "Mesos Slave"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
respawn
respawn limit 2 5
env MESOS_CONFIG="/etc/mesos/conf"
env MESOS_HOME="/usr/local/lib"
env MESOS_LOG_FILE="/var/log/mesos/mesos-slave.log"
umask 007
kill timeout 300
pre-start script
[ -r $MESOS_CONFIG ]
end script
limit nofile 32768 32768
script
exec > $MESOS_LOG_FILE 2>&1
MESOS_SLAVE_ENABLED="no"
[ -e "/etc/default/mesos" ] && . "/etc/default/mesos"
if [ "x$MESOS_SLAVE_ENABLED" = "xyes" ]; then
if [ -e /usr/sbin/mesos-detect-java.sh ]; then
. /usr/sbin/mesos-detect-java.sh
fi
export JAVA_HOME LD_LIBRARY_PATH
exec /usr/sbin/mesos-slave --conf=${MESOS_CONFIG}
fi
end script
@JasonGiedymin
Copy link
Author

Mesos trunk as of 15-rc3 has good upstarts (and I use them), but this script does make use of a better means of detecting java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment