Skip to content
ggodart edited this page Dec 31, 2020 · 2 revisions

The following is an Upstart script that can be used on machines running a version of Linux supporting Upstart. This is yet another alternative method for automatically starting MisterHouse, others include Inittab, StartupScripts. Upstart will automatically restart MisterHouse if it truly exits. However, this script will not perform any test to determine if the instance of MisterHouse has locked up. If you need something like that, look at the WatchDogexamples.

# mh - MisterHouse job file
description "MisterHouse Server"
author "Kevin Robert Keegan <kevin@krkeegan.com>"

# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn

# When to start the service
start on runlevel [2345]

# When to stop the service
stop on runlevel [016]

# Automatically restart process if crashed
respawn

# Stop Trying to Restart if Fail to Start 3 times in 15 seconds
respawn limit 3 15

#Change Directory to MH Binary directory
chdir /usr/local/mh/source/bin

# Set the location of the custom mh.private.ini file
env mh_parms=/usr/local/mh/mh.private.ini
export mh_parms

# Switch to proper user
setuid mh
setgid mh

# Start the process
exec perl mh
Clone this wiki locally