jenkins group while in job is not the same as in terminal

35 views
Skip to first unread message

Tzook Bar Noy

unread,
Dec 3, 2014, 2:30:29 AM12/3/14
to jenkins...@googlegroups.com

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??

Richard Bywater

unread,
Dec 3, 2014, 3:08:01 AM12/3/14
to jenkins...@googlegroups.com

Have you restarted Jenkins since adding the group to the user?

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c12cee83-2dd1-47d3-af3d-3844b9f111e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dirk Heinrichs

unread,
Dec 3, 2014, 3:14:05 AM12/3/14
to jenkins...@googlegroups.com
Am 03.12.2014 um 08:30 schrieb Tzook Bar Noy:

Any ideas why this weird bug happens??

It's not a bug. Running processes don't magically become members of groups you add their owning user to. The user must relogin to become a member of the new group, which in your case means your Jenkins server needs to be restarted (as it logs in as the "jenkins" user).

HTH...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Tzook Bar Noy

unread,
Dec 3, 2014, 3:26:25 AM12/3/14
to jenkins...@googlegroups.com, d...@recommind.com
Did you mean to restart jenkins right?
did it.

I noticed some more info that when I run the command 

command:
cat /etc/group | grep jenkins
result: www-data:x:33:tzook,jenkins
jenkins:x:115:

command:
groups jenkins
result:
jenkins : jenkins www-data web

command:
groups
result:
jenkins

it's like the "real" user jenkins has the groups, but thejenkins user that is currently running has no groups

Matthew...@diamond.ac.uk

unread,
Dec 3, 2014, 3:59:23 AM12/3/14
to jenkins...@googlegroups.com
Is the job running on a slave?
Matthew

Tzook Bar Noy

unread,
Dec 3, 2014, 4:06:37 AM12/3/14
to jenkins...@googlegroups.com
mmm no I think, it's a simple installation, didn't do anything fancy :/ 

On Wed, Dec 3, 2014 at 10:59 AM, <Matthew...@diamond.ac.uk> wrote:
Is the job running on a slave?
Matthew

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/7Jmoeh44Vg4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6836E1DC2DDC174C9D64B7860E5AF5FC9D780BFD%40EXCHMBX01.fed.cclrc.ac.uk.

For more options, visit https://groups.google.com/d/optout.



--

 

Tzook Bar Noy

"Life is what happens while you are busy making other plans"

Phone:        +972.52.4625353

Email:     tzo...@gmail.com


Daniel Beck

unread,
Dec 3, 2014, 6:34:42 PM12/3/14
to jenkins...@googlegroups.com

On 03.12.2014, at 08:30, Tzook Bar Noy <tzo...@gmail.com> wrote:

> in one of my jobs I created an ssh command that simply does

Please be more specific what you're doing. How is SSH involved?

Tzook Bar Noy

unread,
Dec 4, 2014, 1:18:44 AM12/4/14
to jenkins...@googlegroups.com, m...@beckweb.net
sorry it is not ssh, it is a
"build step" with "execute shell"
inside it I have what I mentioned:

    cat /etc/group | grep jenkins
    groups jenkins
    groups
    whoami 

output:

     www-data:x:33:tzook,jenkins
  jenkins:x:115:

  jenkins : jenkins www-data web

    jenkins

    jenkins
Reply all
Reply to author
Forward
0 new messages