SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Testing 'Run script'
Goto page Previous  1, 2
 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Testing 'Run script'
Author Message
laiko



Joined: 11 Feb 2010
Posts: 43
Country: India

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
laiko



Joined: 11 Feb 2010
Posts: 43
Country: India

Post Reply with quote
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 View user's profile Send private message
laiko



Joined: 11 Feb 2010
Posts: 43
Country: India

Post Reply with quote
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.
Code:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
laiko



Joined: 11 Feb 2010
Posts: 43
Country: India

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
laiko



Joined: 11 Feb 2010
Posts: 43
Country: India

Post Reply with quote
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

Code:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
laiko



Joined: 11 Feb 2010
Posts: 43
Country: India

Post Reply with quote
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.