Peter Meier schrieb:
> Hi
> 
> the following exec fails with the trace added:
> 
>     exec{"create_gitosis_git":
>         command => "gitosis-init < initial_admin_pubkey.puppet",
>         cwd => "/home/git",
>         unless => "test -d /home/git/repositories",
>         user => git,
>         path => "/bin:/sbin:/usr/sbin:/usr/bin",
>     }

> as I assume that gitosis-init is using environment variables (like HOME
> etc.) this might explain the problem. However I'm not sure if this is
> the expected behavior if we'd like to run an exec as a different user
> with puppet. This can definitely lead to strange problems, like I
> debugged now for a while.
> On the other side we can say that the users should know which
> environment variables the bins are depending on, which they like to
> execute, so they can easily set them in puppet.
> 
> Somehow both options smell and I'm unsure which one might be the less
> smelly one. Opinions?

For the sake of debuggability, I would tend towards having no 
environment at all (perhaps add a warning in that case if none is set at 
all) or emulating "su -", creating a proper environment according to the 
target user. The former requires more work by the user, but is 
debuggable. The latter probably requires actually using su to avoid the 
intricacies of implementing a user environment setup (pam, shell, etc) 
by hand.


Regards, DavidS

-- 
dasz.at OG              Tel: +43 (0)664 2602670     Web: http://dasz.at
Klosterneuburg                                         UID: ATU64260999

        FB-Nr.: FN 309285 g          FB-Gericht: LG Korneuburg

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to