Author |
Message |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
I logged in as the user, say 'ABC'. Note that Queue directory is owned by root, but it has permission of drwxrwxrwx, so I can create test.sh as ABC. Since ABC created test.sh, it can also change the permission using chmod 755 test.sh. But note that this does not solve the problem.
When I create the job in scheduler (a job that executes in Agent server), it creates it as 'root' and for some reason, the permission on that file does not change to allow 'ABC' to run it. ABC is the agent account. My problem is how to make scheduler change the permission so ABC can run the job.
|
|
Fri Mar 19, 2010 3:46 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
You should change the owner of the scheduler directories from root to ABC and that should solve the issue
|
|
Fri Mar 19, 2010 8:32 am |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
It still did not solve it. I changed the owner from root to ABC of the 24x7_scheduler folder (and subfolders and files) but to no avail. The .sh file that got created in the Queue directory is still owned by root with -rw-r--r-- permission.
|
|
Mon Mar 22, 2010 2:51 am |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
The problem here is that we installed 24x7 scheduler as root. The job connects to a Unix server agent as user ABC. Whenever the job is run, it creates a XXXX.sh file in the Queue folder which is owned by root with permission '-rw-r--r-- '.
I saw that ABC does chmod when job is run. But note that this is not possible since the file owner is root.
 |
 |
2010-03-26 03:48:31,427 [Job #17 - sample1] DEBUG com.softtreetech.jscheduler.business.runner.AbstractJobRunner - runAs() username=ABC command=/bin/chmod,755,/24x7_Scheduler/Queue/1663.sh workDir= |
So my question is: is it possible for the file to be created with '-rwxr-xr-x' permission and avoid that 'chmod' command?
|
|
Fri Mar 26, 2010 7:35 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
I don't think it is currently possible. The file is created as a simple flat text file. And it is the operation system that sets the initial file permissions for that file. 24x7 uses "chmod" command to correct the initial permissions in order to allow the job user to run this file. I don't see anything wrong with that.
The issue here is why chmod command fails on your system? Do you see any messages in syslog indicating reasons for chmod failure? Is it blocked by any chance by SELinux protection? If yes, can you tune or disable that rule to allow chmod calls from scheduler processes?
|
|
Fri Mar 26, 2010 8:59 am |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
These make up the problem:
- the file gets created by root (owned by root)
- the permission is '-rw-r--r-- '
- the file has to be run by user ABC in the agent server
So, it can only be solved if any of the following can be done:
- file is created by ABC
- file has permission allowing ABC to run it
The chmod fails since ABC is trying to perform chmod on the file which is does not own. Basically, why does the file get created with root as owner?
Any solution or workaround?
|
|
Fri Mar 26, 2010 3:06 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
If I'm not missing something important here and the system is not misconfigured, the file is created by root and it is root that is running the chmod command. After the file is created and permissions set, root spawns another process as user ABC and ABC runs that file.
|
|
Fri Mar 26, 2010 4:11 pm |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
Yes, the file is created by root, but I don't think it is root which issues the chmod command. If you look into the log, the username is ABC and what follows is the command=/bin/chmod,755
 |
 |
2010-03-26 03:48:31,427 [Job #17 - sample1] DEBUG com.softtreetech.jscheduler.business.runner.AbstractJobRunner - runAs() username=ABC command=/bin/chmod,755,/24x7_Scheduler/Queue/1663.sh workDir= |
So I think ABC is the one issuing the chmod command - and the file is owned by root, thus, the error is thrown. The chmod is not successful so the execute command is not issued for user ABC.
|
|
Sat Mar 27, 2010 5:08 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Yes, you are correct, that looks rather unusual. Please do me a favor, try setting this job property to detached and not-detached and post 2 fragments from debug.log referring to execution of command=/bin/chmod command. I'd like to see whether the user name in both cases is ABC.
|
|
Sat Mar 27, 2010 11:39 pm |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
The Detached option is not enabled. I noticed that this is enabled only for the job type 'Run database commands (SQL)'. Any other idea?
|
|
Sun Mar 28, 2010 5:50 am |
|
 |
|