Issue #23053 has been updated by Corey Osman.

Status changed from Rejected to Re-opened

So how would I set HOME from a Service resource?

Here is another example where it is broken

<pre>

  service{"puppet":
    ensure => 'enabled',
    provider => "init",
    hasstatus  => true,
    hasrestart => true,
    path       => '/home/user1/etc/init.d',
  }

</pre>


Additionally, any mcollective puppet command is broken too since puppet cannot 
find its HOME.

I think it is unrealistic to make the user specify its home directory every 
time they want to use puppet under nonroot environment. This can easily be 
solved by not using ~. 

Currently this is broken.  The tilde solution does not work, the ENV['HOME'] 
solutions appears to work for 100 of my systems, but I only covered OS X and 
OEL 6.4.  


Under what conditions does ENV['HOME'] result in an empty string?  When does a 
user not have a HOME?



----------------------------------------
Bug #23053: couldn't find HOME environment -- expanding `~/.puppet' when 
running puppet command as non root
https://projects.puppetlabs.com/issues/23053#change-99652

* Author: Corey Osman
* Status: Re-opened
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 2.6.0
* Keywords: nonroot
* Branch: 
----------------------------------------
Puppet seems to have an issue when trying to call itself.  This would normally 
work under root permission but when using a non root user it can't seem to find 
its HOME despite the .puppet directory exists.

for the longest time I though this was just my problem but now its easy to 
reproduce.

Below is a simple test you can run to reproduce the issue.  While printing the 
config issue is not something we do, the output is the same no matter what 
puppet command you run.
<pre>
cat > test.pp << EOF
exec{'puppet_test_nonroot':
     path => ['/bin', '/usr/sbin', '/sbin', '/usr/bin'],
     command => 'puppet config print > /tmp/puppetconfig.txt',
     logoutput => true
}
EOF
puppet apply --verbose test.pp
</pre>

You should get the error:

<pre>
Notice: /Stage[main]//Exec[puppet_test_nonroot]/returns: Error: Could not 
intialize global default settings: couldn't find HOME environment -- expanding 
`~/.puppet'
Error: puppet config print > /tmp/puppetconfig.txt returned 1 instead of one of 
[0]
Error: /Stage[main]//Exec[puppet_test_nonroot]/returns: change from notrun to 0 
failed: puppet config print > /tmp/puppetconfig.txt returned 1 instead of one 
of [0]
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to