Is there a way to override Puppet's removing LOGNAME?

asked 2015-05-12 18:17:34 -0500

mark_klein gravatar image

I have an RPM that is being installed with 'package' that does a check to see of the value of LOGNAME is 'root'. But, because Puppet is erasing that variable:

        Puppet::Util::POSIX::USER_ENV_VARS.each { |name| ENV.delete(name) }

I end up with the installation failing with:

2015-05-12 23:06:07 - Error: Script cannot be run as user: ""
2015-05-12 23:06:07 - 
2015-05-12 23:06:07 - Please log in as root
2015-05-12 23:06:07 - 
2015-05-12 23:06:07 - ..... Exiting

I looked at the post install script in that RPM and it does check LOGNAME, so I need to override it. I've tried various things like setting the environment in an "Exec" but that doesn't carry through to the "package". I'd really hate to do an "exec yum install foo" instead of "package foo".

Anyone got any ideas?

edit retag flag offensive close merge delete