Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer
    
Unless someone else tells me otherwise pretty soon, you're getting the check mark. –  Ladlestein Feb 15 at 3:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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