KimSia Sim wrote: > Under build step execute shell command, I only have the following > echo "running whoami" & whoami > echo "running groups" & groups > echo $PWD > mkdir /var/virtual/stage.xxx.com/test1 > > These are my results. > + whoami > jenkins > + echo running whoami > running whoami > + groups > nogroup > + echo running groups > running groups > + echo /var/lib/jenkins/workspace/LTE develop > /var/lib/jenkins/workspace/LTE develop > + mkdir /var/virtual/stage.xxx.com/test1 > mkdir: cannot create directory `/var/virtual/stage.xxx.com/test1': Permission > denied > Build step 'Execute shell' marked build as failure > Finished: FAILURE > What should I do next?
As you can see from your above output, the Jenkins process is running as a member of the "nogroup" group, not "www-data". This probably means that user "jenkins" is not listed as member of "www-data" in /etc/group. Alternatively, the script which starts Jenkins or Jenkins itself could be explicitly changing the group membership. You need to determine why Jenkins is not running with the group membership you expect. Keep in mind that group membership is determined at process start time so you have to restart Jenkins after changing /etc/group to see any effects. BTW, in a shell script the "&" character means to run the preceeding command in the background, which probably not what you intended as the reason that the output order is odd. Use ';' to separate two commands but execute them sequentially. > > On Saturday, March 9, 2013 12:46:39 AM UTC+8, JonathanRRogers wrote: > > > > On Friday, March 8, 2013 4:51:04 AM UTC-5, KimSia Sim wrote: > > I have this command > > mkdir /var/virtual/folder > > I can execute this when I ssh into my server as `jenkins` > > /var/virtual belongs to www-data, but not an issue because I > made /var/virtual 775 and `jenkins` is a member of `www-data` > group > > > However, when I run the exact same command in my web interface > Jenkins system as a build task, I get a permission denied. > > It might be helpful to put commands in the script run from > Jenkins to print as much about the environment as possible, > including logged in account (whoami) and current group membership > (groups) and current working directory. Prefix the command which > fails with "echo" to make sure it is exactly the same as what you > type interactively. > > -- > 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/GXSmF6RfluM/unsubscribe?hl=en. > To unsubscribe from this group and all its topics, send an email to > jenkinsci-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- Jonathan Rogers -- 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-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.