Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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 0.0.0.0, 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
add comment

Your Answer

 
discard

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.