LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   PPP Failing on Boot up due to lack of serial interfaces! (https://www.linuxquestions.org/questions/debian-26/ppp-failing-on-boot-up-due-to-lack-of-serial-interfaces-945493/)

Crowbar81 05-17-2012 06:02 AM

PPP Failing on Boot up due to lack of serial interfaces!
 
Hi All,
I am relatively new to Linux, but I have gradually been getting up to speed.

I have been fighting with trying to get the PPP link to start up when linux boots.
I am using a Debian 2.6 build. I am connecting my debian build to another machine via PPP over my serial link /dev/ttyS0.

My current set up works fine when I am logged in. I have configured the interfaces file (/etc/network) to have a ppp0 interface that points to a peers file that scripts up the required settings for the serial interface. That script file also points to the chat file, which contains the ppp hand shaking stuff (Who is the client and who is the server).
Using this current configuration I can simply run the command ifup ppp0, which starts the ppp interface and starts talking no problem.

What I was hoping to do, is have the same config to start up automatically in the boot process. The goal is to establish a ppp link even if I am not logged in to my build and this occurs when the pc is powered on.

I thought it would be a simple case of changing the ppp0 interface specified in /etc/network/interfaces to say "auto ppp0". When I changed this config and rebooted my machine, you can see in the boot screen it says serial connection established and then the hand shaking starts and then times out and goes to the login screen.

Once you log in I can do an ifup ppp0 and the connection is established as normal. I used the dmesg command, and I could not see anything out of the ordinary to say that the serial ports were not working or that ppp was not running. :-(

I have just confirmed by using windows hyper terminal from my other PC that in the initial boot phase, there is no ppp chat coming out of the serial interface. The moment I log in and do an ifup ppp0, I can see the data coming out of the serial port.

I have added the setserial to rc3.d and created a symbolic link back to the original file in the init.d. I have also changed the priority level to S01 to try and get the serial to set earlier. After a reboot that still didn’t work. Anyone out there got any ideas how to activate the serial interfaces before the login screen and allow ppp to run?

gillbertiddio 05-17-2012 11:22 PM

the dirty way to start something on boot is adding an entry to rc.local or inittab;

Code:

s1:23:respawn:/usr/sbin/pppd /dev/ttyS0 115200

http://tldp.org/HOWTO/Leased-Line/pppd.html

Crowbar81 05-24-2012 05:18 AM

Fixed it! (I think)
 
Hi All,

After struggling I figured out how to make it happen.

The main problem was not in RC3 where I was looking. (I am such a donut) I needed to be in rcS.d directory, this is all the start up services. When I looked in this directory the setserial service was at the back of the queue, with its priority set to S18setserial. Networking and ifupdown were both further up the boot order. S13networking & S10ifupdown.

I needed setserial to start before the others, so when the network interfaces auto ppp0 runs, there is a serial link to run as well. I found out to change the boot order, you have to modify the scripts.

If you look in init.d and check out the networking and ifupdown scripts. At the very top are a set of parameters. One being the #Required-Start parameter, if you set that parameter with the addition of setserial, the script then knows for it to run, the setserial script must have been run before it.

Once you have modified the scripts you have to update them using the following commands.

update-rc.d networking defaults
update-rc.d ifupdown defaults

Now if you go and look in the directory rcS.d you should see that set serial now sits above ifupdown and networking in the boot order.

Something else I had to do, was modify the setserial script too before the previous commands would work. Linux kept spitting back at me complaining about looping issues. This was because the setserial script settings are as followed.

#Required-start: $remote_fs
#Required-stop: $remote_fs

When I changed the script to the settings below and and ran update-rc.d command like before, the issue went away.

#Required-start: $local_fs
#Required-stop: $local_fs

I am assuming this changed the dependancy to the local file system as before it was remote and that needs more time to boot. My next question is, I have I now manipulated this in a bad way?

Either way currently when I boot up, the ppp link runs with out issue (though I did have to remove nodetach from my ppp script, as that stopped me from logging in (muppet))


All times are GMT -5. The time now is 07:05 PM.