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.


AFAIK, that's all you can get.

Puppet runs the init script and can only check the return code. So I always use the same method like you did, just run the init script manually and look at the error.

  • Unless someone else tells me otherwise pretty soon, you're getting the check mark. – Ladlestein Feb 15 '14 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.