ajcrowe / puppet-supervisord

Puppet Module to install and configure applications under supervisord
MIT License
37 stars 104 forks source link

Possible bug with systemctl manifest if program name contains 'RUNNING' #102

Open ov7a opened 8 years ago

ov7a commented 8 years ago

Currently status check is performed by simple grep (https://github.com/ajcrowe/puppet-supervisord/blob/master/manifests/supervisorctl.pp#L25)

if $unless {
    $unless_cmd = join([$supervisorctl, 'status', $process, '|', 'grep', '-i', $unless], ' ')
  }
  else {
    $unless_cmd = undef
}

So, if program name contains any of possible statuses (ERROR, RUNNING, STOPPED, etc), systemctl program will work with errors. Such names are unlikely to be used, but may cause a lot of pain to debug this issue. At least some warning should be emitted in such case.