Changing the UserID used by JobScheduler on Unix systems
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
utility that could be used, I have looked through the FAQ, could you give us some information please as this could fix our issue?
Answer
The setuid
utility is deprecated.
There are multiple ways running jobs with different user ids in order to access objects belonging to a different user: Use Agent instances Multiple Agents can be operated to run in different accounts from the same Agent installation For details see JobScheduler Universal Agent - Running multiple instances Use To access a file belonging to "other_user" use Make sure that sudo
in the JobScheduler jobsudo -u other_user script_for_other_user.sh
other_user
doesn't require a password for sudo
. This can be achieved by adjusting the configuration from the sudoers
file. This method is extremely flexible - you can change the user more than once within a job. if sudo
requires a password then you can use echo "<password>" | sudo -S -u other_user script_for_other_user.sh