zend-patterns / ZendServerPuppet

ZendServerPuppet
Apache License 2.0
6 stars 16 forks source link

facts.d scripts not working when running puppet agent as a service #59

Open ubellavance opened 7 years ago

ubellavance commented 7 years ago

Logs:

start-puppet-agent: Fact file /var/lib/puppet/facts.d/get_extensions_details.php was parsed but returned an empty data set

start-puppet-agent: Fact file /var/lib/puppet/facts.d/get_directives_details.php was parsed but returned an empty data set

The temporary files are generated correctly in /tmp and I see no SELinux errors. When run manually, the facts scripts produce the right data.

ubellavance commented 7 years ago

I have a hint. A added debug code to one of the scripts and php returns me invalid argument supplied for foreach()

ubellavance commented 7 years ago

https://groups.google.com/forum/#!topic/puppet-users/xATOZRWa49U

ubellavance commented 7 years ago

I found it: the zs-client.phar throws PHP notices when run as a daemon because of undefined variables (HOMEDRIVE and HOMEDIR). I finally re-wrote the script in python so that PHP is not a dependency, but I'm not sure if it was necessary. At least now it's working. I did the extensions script, I'll do the directives script as well and then commit.

ubellavance commented 7 years ago

Should be fixed by #58