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
for Linux (matlabroot
/toolbox/parallel/binmjs_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.
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 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
for Windows® (matlabroot
/toolbox/parallel/binmjs_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.
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:set MJSPASS=password
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 Start > Settings > Control Panel.
Double-click Administrative Tools, then Local Security Policy.
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.