How can I get Puppet to show me the real error when it starts Apache and there's a problem? Is it a limitation of Puppet? Of Apache? Of how I put them together?
I've created a Puppet module for Apache. (I know there's one already, but I'm doing the tutorial.) When I run the module via puppet agent --test
, Apache fails to start. I know it's because one of the Apache modules in httpd.conf isn't installed. Fair enough. But I don't see the exact error message in my agent run. I just see this:
Info: /Stage[main]/Apache/File[httpd.conf]: Scheduling refresh of Service[httpd] Error: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Error: /Stage[main]/Apache/Service[httpd]/ensure: change from stopped to running failed: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1:
Then, when I try starting Apache myself, I see the useful error message.
[root@learn apache]# service httpd start Starting httpd: httpd: Syntax error on line 197 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_mem_cache.so into server: /etc/httpd/modules/mod_mem_cache.so: cannot open shared object file: No such file or directory
Seems like Puppet ought to be telling me what actually happened.