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:

  1. Create and edit a systemd unit file in the/etc/systemd/system folder called mjs.service:
    nano /etc/systemd/system/mjs.service
  2. 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 if systemd can stop or restart themjs service. For more information, see the systemd documentation for your UNIX® platform.
    Save the unit file.
  3. For Red Hat (non-Fedora) platforms, set the unit file permissions:
    chmod 664 /etc/systemd/system/mjs.service
  4. Reload the systemd service files to update your changes:
  5. Enable the mjs systemd service to start automatically at boot time:
    systemctl enable mjs.service
    You can also start the mjs service to verify whether you have successfully configured the mjs systemd service:
    systemctl start mjs.service
    To check the status of the mjs 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.

  1. Use the following command to stop the mjs systemd service:
    systemctl stop mjs.service
  2. Disable the mjs systemd service to prevent the service from starting up again at system reboot:
    systemctl disable mjs.service
  3. 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"
  4. Reload and reset the systemd service files to update your changes:
    systemctl daemon-reload
    systemctl reset-failed

See Also

Topics