Skip to content

Instantly share code, notes, and snippets.

@rhoegg
Last active August 29, 2015 13:55
Show Gist options
  • Save rhoegg/8696853 to your computer and use it in GitHub Desktop.
Save rhoegg/8696853 to your computer and use it in GitHub Desktop.
upstart script for mule 3.4 and earlier
description "Run Mule ESB"
author "Ryan Hoegg"
setuid mule
setgid nogroup
# we need real ethernet before starting:
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [016]
kill timeout 30
script
. /etc/default/mule
exec $MULE_HOME/bin/mule -M-Dspring.profiles.active=$MULE_ENV -M-DMULE_ENV=$MULE_ENV
end script
@cgorshing
Copy link

UPDATE: To have a better working upstart script, I have updated the java service wrapper that comes with Mule and now I'm able to use their "USE_UPSTART" property. Now when doing a "mule install", Mule will install an upstart script.

According to Ryan using a symlink such as:
sudo ln -s /apps/mule/mule-enterprise-standalone-3.4.1/bin/mule /etc/init.d/mule

Doesn't work well:
"the symlink has issues doesn't have a status, restart is iffy, Although I think my upstart script also has restart issues, not waiting long enough"

Other examples of a upstart script
http://bachman.pl/devel/running-mule-esb-as-a-service-in-ubuntu/
http://wiki.nginx.org/Upstart (not specific to Mule)

@rgorsuch
Copy link

rgorsuch commented Jun 7, 2014

Thanks for posting, this helped me. I had to remove the setuid/setguid on Centos 6.5.

@rhoegg
Copy link
Author

rhoegg commented Jul 28, 2014

One reason I use a custom upstart script instead of relying on JSW "install" feature is that I often need to run several instances of Mule side by side.

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