refactored upstart script generation.