Controlling Mule From Startup
This topic describes how to control Mule ESB 3 using the Java Service Wrapper, as well as passing arguments to the JVM to control Mule.
When you run the
mule command, it launches the
mule.sh script in your
MULE_HOME/bin directory. These scripts invoke the Java Service Wrapper (http://wrapper.tanukisoftware.org), which controls the JVM from your operating system and starts Mule. The Wrapper can handle system signals and provides better interaction between the JVM and the underlying operating system. It also provides many advanced options and features that you can read about on the Wrapper website.
The Java Service Wrapper allows you to run Mule as a UNIX daemon, and it can install (or remove) Mule as a Windows NT Service.
The Wrapper provides several properties you can set as described here. If you want to pass additional arguments to the JVM that will run Mule, you can add
wrapper.java.additional.n entries to the
wrapper.conf file in the
/conf directory under the Mule installation directory, or you can pass the arguments at the command line by adding the
For example, to set Mule’s encoding, you could add
wrapper.java.additional.1=-Dmule.encoding=ISO-8859-1 to the Wrapper configuration file, or you could add
-M-Dmule.encoding=ISO-8859-1 to the Mule script at the command line. Note that if you add
wrapper.java.additional.n entries to the configuration file, you must change each instance of
n to a consecutive number, or Java will not parse the properties correctly.
To control the behavior of the Wrapper from the commandline use the -W switch when launching Mule.
For example, to set the logfile that the Wrapper’s uses, you could add
wrapper.logfile=/my/log/file.log to the Wrapper configuration file, or you could add
-Wwrapper.logfile=/my/log/file.log to the Mule script at the command line.