Configure mjs Service to Start Automatically at Boot Time (UNIX) - MATLAB & Simulink (original) (raw)
Main Content
You can use the systemd
system and service manager to start themjs
service at boot time. Although this step is not required, it is helpful in case of a system crash. When configured, the mjs
service starts running each time the machine reboots and continues to run until explicitly stopped, regardless of whether a MATLAB® Job Scheduler or worker session is running.
In the following instructions, matlabroot
refers to the location of your installed MATLAB Parallel Server™ software. Where you see this term used in the instructions that follow, substitute the path to your location.
You must have root privileges to perform these steps.
Debian, Fedora, SUSE, and Red Hat (non-Fedora) Platforms
On each cluster node, create and configure a unit file to automatically start themjs
service at system boot time by following these steps:
- Create and edit a
systemd
unit file in the/etc/systemd/system
folder calledmjs.service
:
nano /etc/systemd/system/mjs.service - Add these configuration options to the
mjs.service
file:
[Unit]
Description=MATLAB Job Scheduler
[Service]
Type=forking
ExecStart=matlabroot/toolbox/parallel/bin/mjs start
[Install]
WantedBy=multi-user.target
You can also specify ifsystemd
can stop or restart themjs
service. For more information, see thesystemd
documentation for your UNIX® platform.
Save the unit file. - For Red Hat (non-Fedora) platforms, set the unit file permissions:
chmod 664 /etc/systemd/system/mjs.service - Reload the
systemd
service files to update your changes: - Enable the
mjs
systemd
service to start automatically at boot time:
systemctl enable mjs.service
You can also start themjs
service to verify whether you have successfully configured themjs
systemd
service:
systemctl start mjs.service
To check the status of themjs
systemd
service, enter this command:
sudo systemctl status mjs.service
Stop systemd
mjs
Service
Normally, you use the systemd
system and service manager to start themjs
service at boot time and continue running until the machine shuts down. However if you plan to uninstall the MATLAB Parallel Server product from a machine, you can also disable the mjs
systemd
service because you no longer need it.
Note
You must have root
privileges to stop or disable themjs
systemd
service.
- Use the following command to stop the
mjs
systemd
service:
systemctl stop mjs.service - Disable the
mjs
systemd
service to prevent the service from starting up again at system reboot:
systemctl disable mjs.service - Manually locate and delete the
mjs
systemd
unit file along with any remaining target files and symbolic links related to it:
find /etc/systemd/system | grep "mjs.service"
find /usr/lib/systemd/system | grep "mjs.service" - Reload and reset the
systemd
service files to update your changes:
systemctl daemon-reload
systemctl reset-failed