plathrop / puppet-module-supervisor

Puppet module for configuring the supervisor daemon tool.
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Add autostart functionality #70

Closed darioblanco closed 10 years ago

darioblanco commented 10 years ago

I am not really familiar to ruby and puppet, and I may be wrong, but one thing I am missing in this module, is being able to use the autostart setting.

I have the use case in which I need to set up some supervisor services, but I don't want to start them automatically. The reason is that, when we provision our instance, and supervisor is trying to start those services, there are some unmet dependencies in specific cases, giving really nasty errors that could be avoided with a manual start in a posterior moment of time, when those dependencies are met (for instance, a development instance). Briefly speaking, we would like to have a supervisord running but with its services stopped whenever they are created.

I actually saw an autostart variable in service.pp:L44, but it is never used. Even if we set functionality for setting it from outside, it is never going to go through. A present ensure with an autostart=false would be the ideal solution.

fungusakafungus commented 10 years ago

You should use supervisor::service{ 'some-service': ensure => stopped, command => '...', }`

This feature was meant exactly for this use case. Needs better docs though.

The possibly unexpected side effect of this is that a manually started service will be stopped by puppet whenever puppet runs.

The autostart variable is used in the template, service.ini.erb.

darioblanco commented 10 years ago

I think your comment may actually work, we need to update the module first and see that we won't break anything.

However, the autostart variable is never used and it confuses me a bit :S

Thanks for the fast response

fungusakafungus commented 10 years ago

autostart is used here: https://github.com/plathrop/puppet-module-supervisor/blob/master/templates/service.ini.erb#L11

Puppet templates can access current puppet scope via @var