[chef] Re: Re: Run Chef in another user


Chronological Thread 
  • From: Ana Ferreira < >
  • To:
  • Subject: [chef] Re: Re: Run Chef in another user
  • Date: Wed, 13 Aug 2014 15:42:59 +0100

Hello Matt

thank for you reply.
i finded very helpfull! 
I could already find the sulotion for my problem.

ty


On Wed, Aug 13, 2014 at 2:54 PM, Matthew Moretti < " target="_blank"> > wrote:

Hey Ana,

execute uses mixlib-shellout under the hood, which in turn (on Unix-y platforms) forks and sets the uid of the child process. So, it does run the command “as” the specified user, but it doesn’t “log in” as that user. If what you need is for your command to run under tcsh as that user, you could use the script resource and specify an interpreter, I think.

I notice that Chef actually has a “csh” resource which might do the trick (since tcsh is csh-compatible).

Matt Moretti



On Wed, Aug 13, 2014 at 9:30 AM, < " target="_blank"> > wrote:

hello,

I'm trying to deploy a software tha has to be install in a expecific user

when I try this, the user doesn't change(stays root).

execute 'install_scos' do
  cwd  '/home/S2K'
 command "/opt/platform3pp/MICONYS/SCOS/S2K-5-5-1-issue-1/installMission.PARC
-c=Single -p=Standalone_single -z=Multi
/opt/platform3pp/MICONYS/SCOS/S2K-5-5-1-issue-1/SDCF_MCNYS61.xml"
  user 'S2K'
  group 'users'
  action :run


Is there a way that i can why chef login in another user., and run commands in
there?
this has to be done in that user because it uses a diferente shell (tcsh).





Archive powered by MHonArc 2.6.16.

§