Configure mjs Service to Start Automatically at Boot Time (UNIX)
You can use the systemd system and service manager to start the
mjs 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 the
mjs service at system boot time by following these steps:
Create and edit a
systemdunit file in the/etc/systemd/systemfolder calledmjs.service:nano /etc/systemd/system/mjs.service
Add these configuration options to the
mjs.servicefile:[Unit] Description=MATLAB Job Scheduler [Service] Type=forking ExecStart=matlabroot/toolbox/parallel/bin/mjs start [Install] WantedBy=multi-user.target
You can also specify if
systemdcan stop or restart themjsservice. For more information, see thesystemddocumentation 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
systemdservice files to update your changes:systemctl daemon-reload
Enable the
mjssystemdservice to start automatically at boot time:systemctl enable mjs.service
You can also start the
mjsservice to verify whether you have successfully configured themjssystemdservice:systemctl start mjs.service
To check the status of the
mjssystemdservice, enter this command:sudo systemctl status mjs.service
Stop systemd mjs Service
Normally, you use the systemd system and service manager to start the
mjs 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 the
mjs
systemd service.
Use the following command to stop the
mjssystemdservice:systemctl stop mjs.service
Disable the
mjssystemdservice to prevent the service from starting up again at system reboot:systemctl disable mjs.service
Manually locate and delete the
mjssystemdunit 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
systemdservice files to update your changes:systemctl daemon-reload systemctl reset-failed