Contact Us 1-800-596-4880

Start and Stop On-Premises Mule Runtime Engine

Start and stop on-premises runtime to run Mule applications on a host you manage. Use these commands after you unpack the distribution and install an Enterprise license. After the runtime is running, deploy Mule application JARs. See On-Premises Mule Runtime Deployment Model and the setup path in On-Premises Runtimes Overview.

Registration with Anypoint Runtime Manager is optional. That registered model is a Hybrid Standalone Runtime.

Deployment status doesn’t appear in the console when the runtime runs as a service or daemon. Look in $MULE_HOME/logs/mule_ee.log (Enterprise) for startup and deployment messages.

Mule runtime engine (Mule) uses the Java Service Wrapper (Tanuki) to control the Java Virtual Machine (JVM) from your native OS. The wrapper provides many options and features, including the ability to run Mule as a Unix daemon or install or remove Mule as a Windows Service. The wrapper can handle system signals and start parameters, and overall provides much better interaction between the JVM and the underlying OS.

Use the Startup and Shutdown Script

The wrapper is called by a script in $MULE_HOME/bin.

This table lists all the parameters that the script accepts:

Parameter Description

start

Starts Mule in the terminal background.

stop

Stops Mule. Inbound endpoints process in-flight messages before Mule shuts down. However, after the timeout period, inflight messages that haven’t completed are abandoned and Mule shuts down.

restart

Restarts Mule.

status

(Linux/Unix only.) Displays the status of the Mule server (running or not running) and the process PID if running.

dump

(Linux/Unix only.) Dumps the Mule wrapper’s core to $MULE_HOME/log/mule_ee.log.

console

Start Mule in the terminal foreground (console mode). Same as running mule with no parameters.

install

Install Mule as a Windows Service or Linux/Unix Daemon.

remove

Remove Mule from your Windows Services or Linux/Unix Daemons.

Start in the Console

Start Mule from a command line by changing the directory to where you unzipped the Mule software distribution and then changing to the bin directory. Run these commands:

  • On Windows environments:

    $ $MULE_HOME\bin\mule.bat
  • On Linux/Unix environments:

    $ $MULE_HOME/bin/mule

These commands run Mule in foreground mode, and the startup script displays information on the terminal’s standard output. You can’t issue further commands on the terminal as long as Mule is running.

To stop Mule, press CTRL-C in the terminal in which the script is running.

Start as a Windows Service

To run Mule as a Windows service, you need to install it first by running:

$ $MULE_HOME\bin\mule.bat install

Once installed, you can run Mule as a service:

$ $MULE_HOME\bin\mule.bat start

When Windows restarts, the Mule service stops the same way as using the mule stop command. The only situation where this could be different is if Windows kills the process due to a timeout.

Start as a Linux or Unix Daemon

Installing the daemon doesn’t create a systemd unit named mule.service. The mule install command registers a Java Service Wrapper (Tanuki) daemon. systemctl start mule fails because that unit doesn’t exist. Use $MULE_HOME/bin/mule start after mule install, not systemctl mule start.

To run Mule as a Linux-Unix Daemon, you need to install it first by running:

$ $MULE_HOME/bin/mule install

Once installed, you can run Mule as a daemon:

$ $MULE_HOME/bin/mule start

You can also start Mule without executing the installation step, which starts Mule in the background of the current user session.

This example starts Mule from a Unix console:

$ $MULE_HOME/bin/mule start
MULE_HOME is set to ~/Downloads/mule-enterprise-standalone-<version>
MULE_BASE is set to ~/Downloads/mule-enterprise-standalone-<version>
Starting Mule Enterprise Edition...
Waiting for Mule Enterprise Edition.................
running: PID:87318

Start from a Script

Starting org.mule.MuleServer from a script or IDE isn’t the usual on-premises runtime path. On-premises runtime starts through the Java Service Wrapper in $MULE_HOME/bin/mule. Use this class only when you embed Mule without the wrapper.

org.mule.MuleServer -config mule-config.xml

or

org.mule.MuleServer -builder <fully qualified classname> -config appContext.xml
  • -config specifies one or more configuration files to use. If this argument is omitted, it will look for and use mule-config.xml if it exists.

  • -builder is a fully qualified classname of the configuration builder to use. If this isn’t set, the default org.mule.config.builders.AutoConfigurationBuilder is used, which will try to auto-detect configuration files based on available builders. In the most common scenario, this will resolve to org.mule.config.spring.SpringXmlConfigurationBuilder.

The easiest way to set the classpath is to include all JARs in the ./lib/mule and ./lib/opt directories of the distribution. You can look at the dependency report for the server and each of the modules to see exactly which JARs are required for a particular module.

Stop On-Premises Mule Runtime Engine

Run the stop command to stop Mule.

This example stops Mule from a Unix console:

$ $MULE_HOME/bin/mule stop
MULE_HOME is set to /Applications/mule-enterprise-standalone-<version>
MULE_BASE is set to /Applications/mule-enterprise-standalone-<version>
Stopping Mule Enterprise Edition...
Stopped Mule Enterprise Edition.

Find Runtime Logs

When you start on-premises Mule runtime engine in the console, startup and DEPLOYED messages print to standard output. When you start it as a Windows service or Linux daemon, those messages don’t go to the terminal.

Look in $MULE_HOME/logs/mule_ee.log (Enterprise Edition) for startup, deployment, and application logs. The mule dump script parameter writes wrapper diagnostics to $MULE_HOME/log/mule_ee.log.

If the log file is missing, the process user cannot write to $MULE_HOME/logs. Confirm that user owns $MULE_HOME and that you started the instance whose MULE_HOME you are inspecting.

Troubleshoot Common Error Messages

Timed out waiting for signal from JVM

The Java Service Wrapper (Tanuki) didn’t receive a ready signal from the JVM before wrapper.startup.timeout. See Configure JVM Memory and Wrapper Timeouts.

JVM received a signal SIGKILL (9)

The operating system killed the JVM. This isn’t a graceful mule stop. Check the out-of-memory killer and whether another process sent SIGKILL.

Pinging the JVM took

The wrapper pinged the JVM and the response was slow. Persistent ping delays can restart on-premises Mule runtime engine automatically.