Main Content

Set MATLAB Job Scheduler Service User

By default, the MATLAB® Job Scheduler job manager and worker services run as the user who starts them. To run the services as a different user, modify the MJSUSER and MJSPASS parameters in the mjs_def file.

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.

Configure Linux User Access for mjs Service

On Linux® operating systems, the MJSUSER requires that the current machine has the sudo utility installed and that the current user is allowed to use sudo to execute commands as the user identified by MJSUSER. For further information, refer to your system documentation on the sudo and sudoers utilities (for example, man sudo and man sudoers).

To run the services as a different user, modify the MJSUSER parameters in the mjs_def file on each cluster node.

You can find the mjs_def file in matlabroot/toolbox/parallel/bin for Linux (mjs_def.sh) To learn more about the parameters in mjs_def file, see Define MATLAB Job Scheduler Startup Parameters.

You must ensure that the user the mjs service runs as has write access to the CHECKPOINTBASE, LOGBASE, PIDBASE, and LOCKBASE folder.

  1. Open the mjs_def file found at:

    matlabroot/toolbox/parallel/bin/mjs_def.sh
  2. Find the line for setting the MJSUSER parameter, and provide a value in the form domain\username:

    MJSUSER="mydomain\myusername"
  3. Save the file.

Configure Windows User Access for mjs Service

The user that the mjs service runs as requires access to the cluster MATLAB installation location. By default, mjs runs as the user LocalSystem. If your network allows LocalSystem to access the install location, you can skip this step. (If you are not sure of your network configuration and the access provided for LocalSystem, contact the MathWorks install support team.)

Note

If LocalSystem cannot access the install location, you must run mjs as a different user.

To run the services as a different user, modify the MJSUSER and MJSPASS parameters in the mjs_def file.

You can find the mjs_def file in matlabroot/toolbox/parallel/bin for Windows® (mjs_def.bat). To learn more about the parameters in mjs_def file, see Define MATLAB Job Scheduler Startup Parameters.

You must ensure that the user the mjs service runs as has write access to the CHECKPOINTBASE, LOGBASE, PIDBASE, and LOCKBASE folder.

  1. With any standard text editor, open the mjs_def file found at:

    matlabroot\toolbox\parallel\bin\mjs_def.bat
  2. Find the line for setting the MJSUSER parameter, and provide a value in the form domain\username:

    set MJSUSER=mydomain\myusername
  3. Provide the user password by setting the MJSPASS parameter:

    set MJSPASS=password
  4. Save the file.

The MJSUSER is granted these permissions on Windows systems:

PrivilegePurposeLocal Security Settings Policy
SeServiceLogonRightRequired to log on using the service logon type.Log on as a service
SeAssignPrimaryTokenPrivilegeRequired to start a process under a different user account.Replace a process level token
SeIncreaseQuotaPrivilegeRequired to start a process under a different user account.Adjust memory quotas for a process

To modify or remove these privileges,

  1. Select the Windows menu Start > Settings > Control Panel.

  2. Double-click Administrative Tools, then Local Security Policy.

  3. In the tree, select Local Policies > User Rights Assignment.

The table above indicates which policies are affected by MJSUSER. Double-click any of the listed policies in the Local Security Settings GUI to alter its setting or remove a user from that policy.

See Also

Topics