As noted by others the init.d script could be better or we could switch to something else like runit or upstart.