Issue #11364 has been updated by John Florian.

Here's a concrete example, where I'm attempting to set up an initial password 
for VNC sessions:

<pre>
    exec { 'set-vncserver-password':
        command => "runuser -l $user -c \"umask 0077 && echo $password | 
vncpasswd -f > ~/.vnc/passwd\"",
        require => Package['tigervnc-server-minimal'],
        unless  => "runuser -l $user -c \"test -e ~/.vnc/passwd\"",
    }
</pre>

Obviously, this example illustrates the necessary kludge of using runuser, 
instead of simply using the "user" parameter to make the "~" reference to the 
appropriate home directory.  Please be aware that I cannot simply replace "~" 
with "/home/$user" because our users' home directories don't share a common 
parent directory.  Instead their path is something more like 
"/home/<DIVISION>/$user" and the <DIVISION> is not readily available to puppet 
nor should it need to be.
----------------------------------------
Bug #11364: Documentation not explicit enough regarding UID/GID of exec
https://projects.puppetlabs.com/issues/11364

Author: John Florian
Status: Unreviewed
Priority: Low
Assignee: 
Category: documentation
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


When reading the docs for the "exec" resource type, it is not clear what 
UID/GID will be used when executing "onlyif" and "unless".  In my testing, it 
appears that these commands will run unaffected by the "user" and "group" 
parameters and if that is indeed the case, I'd argue that to be a bug.  If the 
commands reference things like $HOME or ~, they are likely referencing the 
wrong such ones rather than those specified by the "user" and "group" 
parameters.  In any case, the docs could be more clear regarding this behavior.


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to