Improve the init.d file (issues #188 and #251)
Merge review 182 by @mlucy @coffeemug (Fix #251 #188)