Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On RedHat EL 6, many services can be started and stopped on the command line:

service some_service start


service some_service stop

I have packaged a Node.JS server application in an RPM. How can I register my app to service, for easy start and stop?

share|improve this question
up vote 5 down vote accepted

You will need to write an init script for your service and install it in the /etc/rc.d/init.d directory.

I found one example script on Github; it may be of use to you after some minor customization. And an Internet search will probably turn up other such scripts.

share|improve this answer

Look at the RPM guidelines for Fedora (Fedora is upstream for RHEL, so they should be applicable with some futz for newer versions). You will still have to write the init script, that is more of a black art. Filch the /etc/init.d file for something similar as a starting point, compare to others.

Be advised that Fedora switched to systemd, and it is a given that RHEL 7 will use that also. That means that startup is radically changed (and writing of startup files much simplified). Perhaps you should install latest Fedora and start experimenting.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .