Re: Jenkins pipeline shell set $HOME to /var/www

2017-06-08 Thread Kirill Peskov


On 08.06.17 18:50, R. Tyler Croy wrote:
> (replies inline)
>
> On Thu, 08 Jun 2017, Changqin Xie wrote:
>
>> Using the following Jenkinsfile:
>> #!/usr/bin/env groovy
>>
>> pipeline {
>> agent any
>>
>> stages {
>> stage('Deploy') {
>> steps {
>> sh 'echo $HOME'
>> }
>> }
>> }
>> }
>>
>> And I get $HOME == /var/www
>> Why isn't it being "/home/www-data"? By the way, I am running Jenkins under 
>> the user www-data.
>
> I would be willing to bet that the home directory for the www-data user is
> actually set to `/var/www` in /etc/passwd.
>
> Most Linux packages set the home-directory for that user to /var/www
>
>
>
> - R. Tyler Croy
>
> --
>  Code: 
>   Chatter: 
>  xmpp: rty...@jabber.org
>
>   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
> --
>
If you're working with Debian and/or its derivatives, default user for
webserver is www-data, group www-data and the default home directory for
that user is /var/www

Check if this string exists if /etc/passwd

www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

BTW, in RedHat, CentOS, Fedora, etc. user is apache, group apache and
the home dir is /usr/share/httpd


Cheers,
Kirill

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/08937b3e-e722-a604-7f66-2b969725703f%40paranoid.email.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins pipeline shell set $HOME to /var/www

2017-06-08 Thread R. Tyler Croy
(replies inline)

On Thu, 08 Jun 2017, Changqin Xie wrote:

> Using the following Jenkinsfile:
> #!/usr/bin/env groovy
> 
> pipeline {
> agent any
> 
> stages {
> stage('Deploy') {
> steps {
> sh 'echo $HOME'
> }
> }
> }
> }
> 
> And I get $HOME == /var/www
> Why isn't it being "/home/www-data"? By the way, I am running Jenkins under 
> the user www-data.


I would be willing to bet that the home directory for the www-data user is
actually set to `/var/www` in /etc/passwd.

Most Linux packages set the home-directory for that user to /var/www



- R. Tyler Croy

--
 Code: 
  Chatter: 
 xmpp: rty...@jabber.org

  % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
--

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/20170608165035.a6azgzxiplldv47m%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Jenkins pipeline shell set $HOME to /var/www

2017-06-08 Thread Changqin Xie
Using the following Jenkinsfile:
#!/usr/bin/env groovy

pipeline {
agent any

stages {
stage('Deploy') {
steps {
sh 'echo $HOME'
}
}
}
}

And I get $HOME == /var/www
Why isn't it being "/home/www-data"? By the way, I am running Jenkins under 
the user www-data.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9d6a403a-3072-47b0-90f9-8e470ff59c40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.