error. only root user can exec comands

488 views
Skip to first unread message

Supriya Uppalapati

unread,
Jul 17, 2014, 10:52:23 AM7/17/14
to puppet...@googlegroups.com
Hi,
 
I am having an issue with exc statement. running through non-root user.
 
Error: Failed to apply catalog: Parameter user failed on Exec[extract p17071663_1036_Generic.zip]: Only root can execute commands as other users at /etc/puppetlabs/puppet/environments/testing/modules/wls/manifests/bsupatch.pp
 
 
Let me know how to exec through non root user
 
 
my code is:
 
exec { "extract ${patchFile}":
    113             command => "unzip -n ${puppetDownloadMntPoint}/${patchFile}         -d ${mdwHome}/utils/bsu/cache_dir",
    114             user   => "puppet-admin",
    115             creates => "${mdwHome}/utils/bsu/cache_dir/${patchId}.jar",
    116             before  => Bsu_patch[$patchId],
 
Help me

jcbollinger

unread,
Jul 18, 2014, 12:18:09 PM7/18/14
to puppet...@googlegroups.com


On Thursday, July 17, 2014 9:52:23 AM UTC-5, Supriya Uppalapati wrote:
Hi,
 
I am having an issue with exc statement. running through non-root user.
 
Error: Failed to apply catalog: Parameter user failed on Exec[extract p17071663_1036_Generic.zip]: Only root can execute commands as other users at /etc/puppetlabs/puppet/environments/testing/modules/wls/manifests/bsupatch.pp
 
 
Let me know how to exec through non root user
 


The message seems pretty clear to me.  If you are running Puppet as non-root then you must not specify a 'user' for your command to run as.  You must not specify even the non-root user who happens to be running that puppet agent instance, as Puppet cannot necessarily recognize that that's what you have done.  If you just omit the 'user' parameter from your exec then it will automatically run as whatever user the agent is running as.


John

Reply all
Reply to author
Forward
0 new messages