1

I'm trying to set up my system so that the emacs daemon starts after the machine boots. I've created the file /etc/init.d with the commands I want executed, but when execute update-rc.d, it ignores the sequence numbers I supply.

[host /etc/init.d]$ sudo update-rc.d -n emacs defaults 10 02
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc0.d/K01emacs
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc1.d/K01emacs
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc2.d/S02emacs
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc3.d/S02emacs
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc4.d/S02emacs
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc5.d/S02emacs
insserv: enable service ../init.d/emacs -> /etc/init.d/../rc6.d/K01emacs
insserv: dryrun, not creating .depend.boot, .depend.start, and .depend.stop
[host /etc/init.d]$ 

I'm confused as to why the last two arguments of the command are ignored and whether or not I can ignore the fact that I'm setting the start sequence number to such a low value.

3

update-rc.d defaults doesn't process any other arguments; it uses information from the init script's LSB headers to determine the priority to use (the sequence number), and to determine in which runlevels to start and stop the service.

If your script only depends on $local_fs, it's normal for it to end up with a low sequence number; if you look in /etc/rc2.d you'll see quite a few start links with low sequence numbers. If your script doesn't specify its own runlevels, the defaults are used: start in levels 2—5, stop in levels 0, 1 and 6. To define your own values you'd typically use a header such as

### BEGIN INIT INFO
# Provides: emacs
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop the Emacs daemon
### END INIT INFO

(adjusting the various values as necessary).

You can also use update-rc.d enable and update-rc.d disable to respectively enable and disable a script in a specific runlevel (e.g. update-rc.d emacs disable 3).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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