RUN_AS_USER=muleuserOnce the service is installed you will be able to start Mule as service using your OS service management tool (like Systemd, Init.d, Upstart, Launchd, rc.d, etc.) and as well through the mule command.
$ $MULE_HOME/bin/mule startor:
$ systemctl start mule_ee
chkconfig --add mule chkconfig --levels 345 mule on
| Line | Content | Replace by |
| 17 | WORKDIR=/opt/mule/mule-enterprise-standalone-3.8.1/bin | Replace by the corresponding location of your mule instance BIN directory |
| 20 | AMC_PORT=7777 | Replace the value with the listening port of your mule instance agent |
| 23 | MULE_USER=mule | Replace the value with the linux mule user's name |
/var/log/mule
service mule startThis script starts the mule instance exactly like a linux daemon does, so the mule instance remains running in background with the defined process priorities.
[Unit] Description=MuleSoft Mule ESB Application Container After=network.target syslog.target network-online.target remote-fs.target [Service] Environment="MULE_ENV=prod" Environment="INITMEMORY=1024" Environment="MAXMEMORY=5020" Type=forking ExecStart=/opt/mule/mule-enterprise-standalone-3.8.1/bin/mule start ExecStop=/opt/mule/mule-enterprise-standalone-3.8.1/bin/mule stop User=mule Group=mule LimitNOFILE=102400 [Install] WantedBy=multi-user.targetOnce done, run the following commands as root to refresh the systemd daemon:
systemctl daemon-reload
systemctl start mule -> to start the instance systemctl stop mule -> to stop the instance
systemctl enable mule
POSSIBLE ISSUES:
Mar 28 13:37:00 nyxsvlalb431 systemd[1]: Starting MuleSoft Mule ESB Application Container... Mar 28 13:37:00 nyxsvlalb431 systemd[8119]: Failed at step USER spawning /opt/mule-enterprise-standalone/bin/mule: No such file or directory Mar 28 13:37:00 nyxsvlalb431 systemd[1]: mule_ee.service: control process exited, code=exited status=217 Mar 28 13:37:00 nyxsvlalb431 systemd[1]: Failed to start MuleSoft Mule ESB Application Container. Mar 28 13:37:00 nyxsvlalb431 systemd[1]: Unit mule_ee.service entered failed state. Mar 28 13:37:00 nyxsvlalb431 systemd[1]: mule_ee.service failed.However, you noticed that you are able to start this script manually after the system has finished booting:
systemctl status mule_ee.serviceThis may be due to the fact the mule file or directory has not been mounted by the startup scripts yet. Please try forcing the mule startup script (mule.service) to load at the end of startup by changing line 8 of the script above from:
Type=forkingto:
Type=idleThen, refresh the systemd daemon:
systemctl daemon-reload
Jul 25 14:01:16 vernon12s systemd[1]: Starting MuleSoft Mule 4.2 ESB Application Container... Jul 25 14:01:17 vernon12s mule[10262]: MULE_HOME is set to /home/api/mulesoft/mule-enterprise-standalone-4.2.0 Jul 25 14:01:17 vernon12s mule[10262]: MULE_BASE is set to /home/api/mulesoft/mule-enterprise-standalone-4.2.0 Jul 25 14:01:27 vernon12s mule[10262]: Starting Mule Enterprise Edition... Jul 25 14:02:46 vernon12s systemd[1]: mule42.service start operation timed out. Terminating. Jul 25 14:02:46 vernon12s systemd[1]: Failed to start MuleSoft Mule 4.2 ESB Application Container. Jul 25 14:02:46 vernon12s systemd[1]: Unit mule42.service entered failed state. Jul 25 14:02:46 vernon12s systemd[1]: mule42.service failed.This is due to the fact that the mule service takes longer to start up on certain slow or busy machines.
systemctl show mule42 | grep -i timeoutstart TimeoutStartUSec=1min 30sIntroduce a larger timeout setting in mule service script [Service] section, for example:
TimeoutStartSec=5minThen, refresh the systemd daemon:
systemctl daemon-reloadConfirm the change is up to date before rebooting machine, for example:
systemctl show mule42 -p TimeoutStartUSec TimeoutStartUSec=5min
Nov 01 23:39:28 0aaeb244 systemd[1]: Starting MuleSoft Mule ESB Application Container... Nov 01 23:39:28 0aaeb244 systemd[1]: mule.service: control process exited, code=exited status=216 Nov 01 23:39:28 0aaeb244 systemd[1]: Failed to start MuleSoft Mule ESB Application Container. Nov 01 23:39:28 0aaeb244 systemd[1]: Unit mule.service entered failed state. Nov 01 23:39:28 0aaeb244 systemd[1]: mule.service failed.This is due to the fact that there is something wrong with the group name value in mule.service file created in /usr/lib/systemd/system path.
#******************************************************************** # Wrapper Properties #******************************************************************** # Uncomment this line in the case of startup failure. wrapper.debug=true
001114850

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.