4

I have installed jenkins on our dev server, and I added the user "jenkins" to some groups for example www-data.

now when I run this command on the terminal:

groups jenkins

I get this output

jenkins www-data

and that is ok, but in one of my jobs I created an ssh command that simply does

groups jenkins

and the result is

jenkins

as you can see the "www-data" group is missing, so I have some permissions errors.

Any ideas why this weird bug happens??

2 Answers 2

1

Your Jenkins runit setup may be using chpst to run as the jenkins user with only the jenkins group. Check your /etc/sv/jenkins/run, if it has exec chpst -u jenkins -U jenkins, change it to exec chpst -u jenkins:jenkins:www-data -U jenkins and restart

0

Replying because I had a similar problem but was not running runit.

My system is running remoting - https://www.jenkins.io/projects/remoting/

Problem:

  • jenkins got added to wheel and root groups
  • Subsequent calls to sudo as jenkins failed
  • jenkins was removed from wheel and root, but sudo still failed
  • As jenkins user, verified through ssh that the groups were gone
  • Adding call to /bin/id as a line in the Execute shell Build script showed that the jenkins user was still member of the groups

Fix: As jenkins user, restart java remoting

  • ps -ef | grep remoting
  • kill [remoting id]
  • cd [jenkins jar folder]
  • java -jar remoting.jar -workDir /web/jenkins -jar-cache /web/jenkins/remoting/jarCache

EDIT: There must be a more elegant way to restart the server. I'll update this if/when I find it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .