cancel
Showing results for 
Search instead for 
Did you mean: 

script issue

SOLVED
Go to solution
himacs
Super Advisor

script issue

Hi Admins,

I need some help regarding script execution.

we have a script which has got full permission wth normal user say 'test'.
when the test executes the script ,it throwing error..
./stop: kill: permission denied

The script contains kill command

I think user does not have permission to run kill command.

How to solve this issue..


Regards
himacs
8 REPLIES
Patrick Wallek
Honored Contributor

Re: script issue

That is possible. If you suspect that permissions are the issue, check the permissions of the 'kill' command and see if this user has permission.


The other, slightly more likely, possibility is that the script is trying to kill a process that was not started by this user.
R.K. #
Honored Contributor

Re: script issue

Hi Himacs,

See what happens if you run that command (or script) manually from that User....if you still get same error message, then probably it is a permission issue.

(It depends what is done/killed by the script. May be the process it is trying to kill requires root powers.)
Don't fix that what ain't broke
Suraj K Sankari
Honored Contributor

Re: script issue

Hi,

Give sudo nopasswd access to all user who is using this scirpt

sudo nopasswd access to kill command

nopasswd because when script will run then passwd will not ask.

Suraj
himacs
Super Advisor

Re: script issue

HI Admins,

Thanx for th reply.

The script is trying to kill a PID file,own by root user.I have set ACL permission for that user with PID file.
Waiting for user's update..

Whether i have to give ACL for group also,wher that user belongs..?

Regards
himacs
himacs
Super Advisor

Re: script issue

Hi Admins,

ACl didnot work..

Need i change the mill permission for that user ...


regards
himacs
Dennis Handly
Acclaimed Contributor

Re: script issue

>Whether I have to give ACL for group also, where that user belongs?

Is your problem reading the PID file or killing the process?

ACLs will allow you to read the file but not kill PIDs. The error looks like the latter.
James R. Ferguson
Acclaimed Contributor

Re: script issue

Hi:

> we have a script which has got full permission wth normal user say 'test'.
when the test executes the script ,it throwing error.../stop: kill: permission denied

You might want to verify that your script is finding _correctly_ what it wants to kill. It is possible that your script is trying to kill a process that it shouldn't and then fortunately for you the kernel denies that.

Regards!

...JRF...
OldSchool
Honored Contributor
Solution

Re: script issue

"The script is trying to kill a PID file,own by root user"

That would seem to imply that the PID that you want to kill is owned by root as well, at least from the sketchy infomation provided....

what user id is running the script?
the exact kill command that is being attempted?
if the "PID file" ref'd above has a process ID in it, what does "ps -ef" show for the specified process?

As noted before, non root users can only kill processes that they own...I'd start with finding out who owns what and go from there.