Discussion:
[Supervisor-users] Rant and proposal for LSB-compliant initscript for EL6
Erwan Queffélec
2015-03-28 19:30:57 UTC
Permalink
# TL;DR:
* My team is getting quite upset with the non-LSB compliant behavior of
RedHat initscripts found on [github](
https://github.com/Supervisor/initscripts)
* I decided to write our own and send a [pull request](
https://github.com/Supervisor/initscripts/pull/28). Goodbye, non-conforming
return codes !
* But hey, wait, we're still wondering why there was none available in
the first place. Have we overlooked something ?

# Background & obnoxious rant

* we use Ansible to deploy supervisord. Whenever we want to ensure
supervisord is started, supervisord start operation shamelessly fails with
non-zero return code, stating it's "already started". That's bad. The
ansible task fails, as it's expecting start to be idempotent and return 0
if the *is* started at the end of the operation
* Open-space background noise is filled with comments such as "LSB has been
around since I was playing with my poop and there are a shitload of good
examples around, why the f*** are supervisord initscripts non-compliant ?"
* Quite seriously, that's right. IMHO writing non-LSB-compliant initscripts
is almost a waste of time. For those not aware of LSB expectations, [here
they are](
http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html).
If you're not writing init scripts that way, you are doing it wrong. So
please consider reading this if you are writing any. Your advanced users
and admins - those who can't or won't switch to systemd - will be more than
thankful
* And of course, as supervisord users, we still ARE very thankful for the
contributors and maintainers hard work !

# Solution

* Write my own instead of just complaining. "Contribute nothing, expect
nothing", so here is my contribution. Feel free to use it, report bugs and
improve it.
* While the PR is still pending, you can fetch this initscript from [my
fork](https://github.com/3rwww1/supervisor-initscripts/).
* It's very similar to the official httpd initscript. There are few
different ways of writing a correct initscript anyway.
* I'll have rpm packages available for download soon™

# Questions & Caveats
* I tested it. A bit. I recommend running it in pre-prod/test during quite
some time before using it in production. Chances are my team will be using
it for business-critical services starting next month. Maybe. If that's the
case and we find any bugs, I'll fix them. At least I intend to
* As we were too busy complaining and not writing anything, I might have
overlooked a good reason why:
* LSB-compliance is a bad idea
* using /etc/init.d/functions is a bad idea
So, feel free to tell me if there are any.


Kind regards,

Erwan

Loading...