Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Last active March 21, 2021 21:29
Show Gist options
  • Save kwilczynski/5209531 to your computer and use it in GitHub Desktop.
Save kwilczynski/5209531 to your computer and use it in GitHub Desktop.
Mesos upstart startup script
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/lib/mesos"
env MESOS_LOG_FILE="/var/log/mesos/mesos-master.out.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/lib/mesos"
env MESOS_LOG_FILE="/var/log/mesos/mesos-slave.out.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
@kwilczynski
Copy link
Author

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