Raspberry Pi script boot order

2k views Asked by At

There're three forms about running a script on the boot of the Raspberry, that are modifying /etc/rc.local, modifying the cron daemon and making a script that automatically run on boot in /etc/init.d

I want to know which of the methods listed about executed first.

The point of the question is that I'm trying to run wvdial with an Alcatel X600D at boot, that is as simple as modify the /etc/network/interfaces with these lines:

auto ppp0
iface ppp0 inet wvdial

But the problem is that the modem needs to receive the PIN before the wvdial is called. For that, I need to pass the PIN to the modem before the system raises the ppp0 connection.

Regards.

1

There are 1 answers

0
fleed On BEST ANSWER
  1. Script in /etc/init.d
  2. Whatever is in /etc/rc.local
  3. Your cron daemon command

Proof: Scripts in /etc/init.d are ran according to their priority and dependencies (look within the files in /etc/init.d and in the runlevel directories /etc/rc*.d)

cat /etc/rc.local

get

# This script is executed at the end of each multiuser runlevel.

Cron scripts are executed whenever the timing pattern specified in them is reached which is independent from the boot order. So a script in cron probably would not make much sense.

Also have a look at https://wiki.debian.org/Modem/3G, it might be possible to do what you're trying to achieve without coding your own script.