jarrodr
Posts: 19
Joined: Tue Jun 19, 2012 4:55 pm
Location: South Africa

Changing start-up sequence

Thu Jan 09, 2014 7:35 pm

Hi guys,

Sometimes I cannot remote into my PI using ssh. Because it seems that the mounting service fails before it can start the sshd service.

Is it possible to change the service start-up sequence? like move sshd before the mounting.

Image

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Changing start-up sequence

Thu Jan 09, 2014 7:46 pm

Have a look in /etc/rc2.d

In there there's a bunch of symlinks that are run in number order.

The S##functionname scripts run at start up
The K##functionname scripts run at shutdown (or when you switch from run level 2 to run level 6)

Each script (except mathematica where it's missing) has dependency info in the header. That's used by update-rc.d to define what order scripts run in.

You can't do anything before the local filesystems are mounted with read/write access.

It's unusual to start a network service (like sshd) before the interface(s) are alive and connected.

So its relatively easy to change the order.

If you have S05foo and S05bar they have the same position in the queue by number so it's alphabetical, bar runs before foo (assuming no other dependencies).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Raspberry Pi OS”