[chef] Re: Re: Re: Chef bash resource not executing as specified user


Chronological Thread 
  • From: Arthur Kalmenson < >
  • To:
  • Subject: [chef] Re: Re: Re: Chef bash resource not executing as specified user
  • Date: Wed, 25 Jan 2012 11:32:42 -0500

Leonardo,
Yes, running as sudo

Joseph,
Yeah, it looks the same to me as well. But how would I work around that?

Daniel,
That makes sense, but is there a way to source it so it runs as if it's logged in?

Thank you all for your help.

--
Arthur Kalmenson


On Wed, Jan 25, 2012 at 11:18 AM, Daniel DeLeo < "> > wrote:


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.

§