Ask Your Question

Failed to call refresh: /etc/init.d/monit reload returned 1 instead of one of [0]

asked 2013-09-08 16:09:54 -0600

shyp gravatar image

updated 2013-09-17 10:00:37 -0600

golja gravatar image

Hello , I have this code:

exec {"reload_monit" :
  command => "/etc/init.d/monit reload ",
  path => "/usr/local/bin/:/usr/sbin/:/bin/",
  refreshonly => true,

for some reason it gives me this output ,

Error: /Stage[main]/Website-post/Exec[reload_monit]: Failed to call refresh: /etc/init.d/monit reload  returned 1 instead of one of [0] Error: /Stage[main]/Website-post/Exec[reload_monit]: /etc/init.d/monit reload  returned 1 instead of one of [0]

try to add timeout but got the same status ...

can u help plz ?

edit retag flag offensive close merge delete



Add logoutput => 'on_failure', to your exec and re-run Puppet with the -td flags: sudo puppet agent -td Post results from the new run via a Gist or Pastebin URL

bmurts gravatar imagebmurts ( 2013-09-09 10:32:55 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2013-09-09 00:15:04 -0600

Ancillas gravatar image

The monit reload is failing. Run the restart manually and see what the error message is. Probably a bad config. Note that this isn't a Puppet error, but a monit error. /etc/init.d/monit is returning 1 when Puppet calls /etc/init.d/monit reload.

edit flag offensive delete link more


Permissions? Does Puppet have access to the init script?

Ancillas gravatar imageAncillas ( 2013-09-09 02:22:56 -0600 )edit

Thanks , in order to solve I was need to run it with sudo before the command .

shyp gravatar imageshyp ( 2013-09-10 08:29:41 -0600 )edit

Excellent. Please mark this answer as the solution if you feel your problem has been solved.

Ancillas gravatar imageAncillas ( 2013-09-10 11:27:01 -0600 )edit

Sorry , but how ? :-)

shyp gravatar imageshyp ( 2013-09-11 13:17:10 -0600 )edit

Next to the answer you'll see a "0" with an up arrow above, and a down arrow below. You can up and downvote answers to help arrive at a ...(more)

Ancillas gravatar imageAncillas ( 2013-09-12 12:48:40 -0600 )edit

answered 2014-01-30 04:08:21 -0600

davemidd gravatar image

updated 2014-01-31 05:18:03 -0600

"reload" is not a valid option for the monit init script. You can run "monit reload" to reload the config but that's not the same as running "/etc/init.d/monit reload"; the former is calling the monit binary to do the reload whereas the latter is using the init script.

One tip is to add "set -x" towards the top of the monit init script (before the variables are set) and run your command. This will expand all the commands as they're run.

+ PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/sbin/monit
+ CONFIG=/etc/monit ...
edit flag offensive delete link more

answered 2013-09-09 01:38:47 -0600

shyp gravatar image

Thanks for you answer ,

I try to do it several times but on the command line I am not getting any errors ...

I am not sure what can couse it to work on command line and not on puppet ...

I also try to run it in debug mode but I dont see more information about the reason it failed .

edit flag offensive delete link more


You should move this to a comment instead of a proposed answer.

Ancillas gravatar imageAncillas ( 2013-09-09 02:21:57 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-09-08 16:09:54 -0600

Seen: 3,045 times

Last updated: Jan 31 '14