On Saturday, January 11, 2014 6:56:29 AM UTC-6, bluethundr wrote:
>
> Hey all,
>
> I've created a number of puppet modules that control services in the form 
> of init scripts on the hosts it controls.
>
> However I recently created a logstash init script and a puppet module to 
> control it. It also should push out a config file.
>
>
> And the logstash module cannot control the logstash init script, even tho 
> the module was created in the same way as the other modules I've done. So 
> my thinking is that there may be a problem with the init script.
>
>

That is usually where the issue resides in cases like this, but I don't 
immediately see anything wrong with the initscript you presented.


Allow me to demonstrate:
>
> Step 1, stop services and remove files that puppet is meant to control:
>
> root@logs:~] #service httpd stop
> Stopping httpd:                                            [  OK  ]
> [root@logs:~] #service bacula-fd stop
> Shutting down bacula-fd:                                   [  OK  ]
> [root@logs:~] #service logstash stop
> Stopping Logstash Daemon: Terminated
>


It's a little suspicious that shutting down the Logstash daemon did not 
cause the standard "[ OK ]" response to be emitted.  It looked like the 
script was using the standard daemon-control tools, but they should have 
emitted the standard response.

 

> [root@logs:~] #rm /etc/sudoers
>
> The manual puppet run:
>
> [root@logs:~] #puppet agent --test --server puppet.mydomain.com
>


That would be a lot more informative if you also specified the --debug 
option to obtain additional logging.

 

> Info: Retrieving plugin
> Info: Caching catalog for logs.jokefire.com
> Info: Applying configuration version '1389442074'
> Notice: /Stage[main]/Apache/Service[httpd]/ensure: ensure changed 
> 'stopped' to 'running'
> Info: /Stage[main]/Apache/Service[httpd]: Unscheduling refresh on 
> Service[httpd]
> Notice: /Stage[main]/Sudo/File[/etc/sudoers]/ensure: defined content as 
> '{md5}4682d5ac1b693284dd615a4366a2e8ce'
> Notice: /Stage[main]/Bacula-client/Service[bacula-fd]/ensure: ensure 
> changed 'stopped' to 'running'
> Info: /Stage[main]/Bacula-client/Service[bacula-fd]: Unscheduling refresh 
> on Service[bacula-fd]
> Notice: Finished catalog run in 1.18 seconds
>
>

Because Service[logstash] does not appear in Puppet's output, either the 
catalog you are applying does not specify it, or Puppet thinks it is 
already in the target state.  (Debug logging should differentiate between 
those alternatives.)  If the latter, then there is probably an issue with 
the script's 'status' command.  For best results, the script should comply 
with LSB: 
http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
 
.


John

 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6f7955f3-0b5e-4b55-94cb-96ea7dd12270%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to