Set MATLAB Job Scheduler Service User - MATLAB & Simulink (original) (raw)
Main Content
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
andMJSPASS
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 byMJSUSER
. For further information, refer to your system documentation on thesudo
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 inmjs_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.
- Open the
mjs_def
file found at:
matlabroot/toolbox/parallel/bin/mjs_def.sh - Find the line for setting the
MJSUSER
parameter, and provide a value in the formdomain\username
:
MJSUSER="mydomain\myusername" - 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 userLocalSystem
. 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 runmjs
as a different user.
To run the services as a different user, modify the MJSUSER
andMJSPASS
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 inmjs_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.
- With any standard text editor, open the
mjs_def
file found at:
_matlabroot_\toolbox\parallel\bin\mjs_def.bat - Find the line for setting the
MJSUSER
parameter, and provide a value in the formdomain\username
:
set MJSUSER=mydomain\myusername - Provide the user password by setting the
MJSPASS
parameter: - Save the file.
The MJSUSER
is granted these permissions on Windows systems:
Privilege | Purpose | Local Security Settings Policy |
---|---|---|
SeServiceLogonRight | Required to log on using the service logon type. | Log on as a service |
SeAssignPrimaryTokenPrivilege | Required to start a process under a different user account. | Replace a process level token |
SeIncreaseQuotaPrivilege | Required to start a process under a different user account. | Adjust memory quotas for a process |
To modify or remove these privileges,
- Select the Windows menu > > .
- Double-click Administrative Tools, then Local Security Policy.
- In the tree, select > .
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.