- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Chef bash resource not executing as specified user
- Date: Wed, 25 Jan 2012 08:18:40 -0800
On Wednesday, January 25, 2012 at 7:23 AM, Joseph Reynolds wrote:
>
Hi Arthur,
>
>
The problem is that the normal environment for hubot_user isn't being
>
loaded during the bash resource run. Because the hubot-user is running the
>
npm command, but has the environment of the chef-client-user, it is writing
>
the npm logs to the chef-client-user's home folder, which it doesn't have
>
permissions for.
>
>
At least that's what it looks like to me.
>
>
Joe
Setting the user in a script or execute resource will change the UID that the
process runs as, but this is not the same as logging in as that user at the
console. In particular, profile and rc scripts will not be sourced as they
would during a normal login. The man page for bash explains this under the
"Invocation" section:
http://linux.die.net/man/1/bash
--
Dan DeLeo
Archive powered by MHonArc 2.6.16.