-1

I am Mahesh. I installed jenkins in my linux machine,IT works well as a normal user, When i try to run one script in super user [root] mode,It is not working properly,Even i disable the password in sudoers file it is not working and also It not giving any error It just running the script in normal user instead of root ?? what i do? how i can resolve this problem ??

I just add like this in shell script coloumn in jenkins...

sudo su //comment-->I disable the password so no password required ,I tested in the terminal and am able to enter into root without password with this

sh something.sh

Mahesh
  • 705
  • 3
  • 8
  • 17
  • 2
    How did you install Jenkins? Which version? Which Linux distribution are you using? Which version? What does your /etc/sudoers file look like? – sti Aug 08 '12 at 20:11
  • possible duplicate of [How to run a script as root in Jenkins?](http://stackoverflow.com/questions/11880070/how-to-run-a-script-as-root-in-jenkins) – Display Name is missing Jan 31 '15 at 16:05

1 Answers1

5

I would advise against running Jenkins (or any application server) as the root user.

Instead of battling the sudo command, why not install the Jenkins ssh plugin and configure the jenkins user to perform an ssh login to the root account?

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • this could be a good solution. could you please provide a quick walkthrough? as i've downloaded the plugin, but cannot get it to login to localhost. i've searched and read my ass off : http://stackoverflow.com/questions/6313929/how-do-i-open-port-22-in-osx-10-6-7 f.e. yet i still cannot get it work. – Michahell Oct 27 '12 at 16:20
  • Yes, i am. Thanks for coming back to this, i've decided to use the standalone Jenkins app someone made. This seems more logical, then i also not have to have it run allways, as i'm not allways developing anyway :) – Michahell Nov 04 '12 at 10:52