Changing the UserID used by JobScheduler
Question
One of the files on our file system belongs to a different user to that used by our JobScheduler.
This is causing the following errors:
2012-10-15 18:26:27.360 [info] SCHEDULER-918 state=starting (at=2012-10-15 18:26:27.333) 2012-10-15 18:26:27.361 [info] SCHEDULER-987 Starting process: '/bin/sh' '-c' '"/tmp/schedule/sos.ABC"' 2012-10-15 18:26:27.475 [info] /tmp/schedule/sos.ABC: line 4: ./TDloadXXX: Permission denied 2012-10-15 18:26:27.475 [info] SCHEDULER-915 Process event 2012-10-15 18:26:27.476 [ERROR] SCHEDULER-280 Process terminated with exit code 126 (0x7E)
I noticed there is a SETUID
that could be used, I have looked through the FAQ, could you give us some information please as this could fix our issue?
Answer
SETUID
has been depreciated.
There are, however, two other possible ways of accessing an object belonging to another user such as "other_user".
- If you are running on Unix:
-
- Use
sudo
in the JobScheduler job :sudo -u other_user script_for_other_user.sh
Make sure that _other_user_ doesn't need a password for sudo. This is done by editing the _sudoers_ file. This method has the advantage that it is extremely flexible - you can change the user more than once within a job.
- Use
- If it is not possible to use
sudo
or its Windows equivalent or if all the files you are accessing have the same owner you can either use SSH or a JobScheduler Agent.Note that you can use SSH on your own computer. This is described in part 2 of the following FAQ: