Server Fault is a question and answer site for system and network administrators. 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

I often see start on runlevel [2345] in Upstart init scripts, but sometimes (e.g., here) I see other events being used to determine start time. How do I know which events (or status codes) should be used for a given program? For instance, I am currently using just runlevel [2345] for Postgres and Pgbouncer, but I'm not sure if that's really the best idea.

share|improve this question
up vote 3 down vote accepted

You should probably spend some time looking at some documentation (generally good advice for anything) as it really depends upon your service and what it's requirements are. There is no generic 'best' only that which meets the requirements of your service.

The difference in whether to use the more generic 'runlevel' or the more explicit local-filesystems(7) and net-device-up events should be guided by your job's behaviour. If your service will come up without a valid network interface (for instance, it binds to, or uses setsockopt(2) SO_FREEBIND), then the runlevel event is preferable, as your service will start a bit earlier and start in parallel with other services.

However if your service requires that a non-loopback interface is configured for some reason (i.e., it will not start without broadcasting capabilities), then explicitly saying "once a non loopback device has come up" can help...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.