Ask Your Question

Why Exec executes commands differentely than by interactive shell? (or: puppetlabs-apt: on Linux Mint: add-apt-repository mysteriously lies)

asked 2014-02-04 06:44:40 -0500

Adam Ryczkowski gravatar image

Linux Mint is a Ubuntu-derrived distribution, that - among other things - runs its own version of add-apt-repository, which is located on /usr/local/bin (the original add-apt-repository still can be found on /usr/bin). The syntax is the same. I guess the most important thing it does is that it handles different releases on repositories: linux mint has its own release named petra for Linux Mint 16, while it is also compatible with the Ubuntu's saucy.

For obvious reasons, to get the puppetlabs-apt working on Linux Mint, I needed to change the hard-coded path to the add-apt-repository. After that modification ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-02-04 13:14:21 -0500

Stefan gravatar image

To have consistent behaviour between running puppet from the commandline and running puppet as a daemon that gets started during boot time, puppet resets certain environment variables (redmine ticket #5224). Namely this is HOME, USER and LOGNAME.

I suspect gnupg relies on $HOME to determine the keyring etc. Try setting HOME (or even better GNUPGHOME) with the environment parameter of the exec resource.

edit flag offensive delete link more


No... None of these environment variables had worked for me. I systematically added ALL environment variables. Any other thoughts?

Adam Ryczkowski gravatar imageAdam Ryczkowski ( 2014-02-07 11:20:31 -0500 )edit

You are running puppet as root, right? Maybe the user has a different `$PATH`. Try using an absolute commandline in your exec resource and use the `path` parameter of the ...(more)

Stefan gravatar imageStefan ( 2014-02-07 18:44:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-04 06:44:40 -0500

Seen: 822 times

Last updated: Feb 04 '14