puppet-supervisord icon indicating copy to clipboard operation
puppet-supervisord copied to clipboard

Program ignores refreshing

Open ov7a opened this issue 9 years ago • 1 comments

For example, I need some supervisor service. I declare a manifest for config file and a manifest for supervisor::program. Then I add "subscribe" parameter to latter. I expect that when config changes, puppet notifies supervisor::program with refresh event and it should restart service. But this does not happen. I see only refresh of Exec[supervisorctl_command_start_<program>]. So just start signal is sent, not restart. This behavior should be fixed.

ov7a avatar Aug 22 '16 08:08 ov7a

Possible fix (program.pp):

  ...
  case $ensure_process {
    'stopped': {
      supervisord::supervisorctl { "stop_${name}":
        command => 'stop',
        process => $name
      }
    }
    'removed': {
      supervisord::supervisorctl { "remove_${name}":
        command => 'remove',
        process => $name
      }
    }
    'running': {
      supervisord::supervisorctl { "start_${name}":
        command => 'start',
        process => $name,
        unless  => 'running'
      }

      supervisord::supervisorctl { "restart_${name}":
        command => 'restart',
        process => $name,
        refreshonly => true
      }
    }
    default: { }
  }

ov7a avatar Aug 22 '16 09:08 ov7a