I am assuming the kill command is failing. Outside of your script, if you have sudo setup correctly, the user who is running the script should be able to run the command:
sudo kill <pid #> If that fails, you need to fix the sudoers configuration. In your script, just add 'sudo' to the kill command. #!/bin/sh pid=$(pidof postgres) echo $pid sudo kill $pid pg_ctlcluster 8.4 main start Same goes for the pg_ctlcluster command if sudo needs to get called for that. From: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Varghese Renny Sent: Tuesday, June 26, 2012 8:04 AM To: jenkinsci-users@googlegroups.com Subject: Re: Re: Re: jenkins java.outofmemory:permGen space error #!/bin/sh pid=$(pidof postgres) echo $pid kill $pid pg_ctlcluster 8.4 main start I am doing only this much of thing ...in command prompt i used sudo kill manullay... but in shell while i executing it's saying operation not permitted kill : 4 : operation not permitted.. i assume this is some permission problem..How can i resolve that?