Automating pppd or diald startup after paower fail

Automating pppd or diald startup after paower fail

Post by Mike Jam » Thu, 02 Nov 1995 04:00:00



Greetings folks,

I am new ISP and currently used the super nice diald script to maintain
my connection to the internet.  What I realized I need now is a way to
automatically initiate a ppp or diald script during bootup after after a
power fail occurs.

I understand you can do this either in the inittab or rc.local files but
am not sure how to implement the confiuration to start a ppp script and
have it respawn if the connection dies (likewise w/ diald).  I had some
help from some kind folks here before, but lost their messages (don't
know if an archive for this group exists either).

Thanks alot in advance,

-Mike James

 
 
 

Automating pppd or diald startup after paower fail

Post by Mike Jam » Fri, 03 Nov 1995 04:00:00





>>Greetings folks,

>>I am new ISP and currently used the super nice diald script to maintain
>>my connection to the internet.  What I realized I need now is a way to
>>automatically initiate a ppp or diald script during bootup after after
a
>>power fail occurs.

>>I understand you can do this either in the inittab or rc.local files
but
>>am not sure how to implement the confiuration to start a ppp script and
>>have it respawn if the connection dies (likewise w/ diald).  I had some
>>help from some kind folks here before, but lost their messages (don't
>>know if an archive for this group exists either).

>Well, as far as diald is concerned, you should be able to just
>start diald in your rc.local file the same way you start it
>from the command line. I've recently had a bug report that
>this won't work as expected if the rc script finishes before
>diald forks into the background. I'll be fixing this in the
>next release, but in the mean time you can avoid this by
>either running diald in your rc.local with (for example)

>setsid /usr/sbin/diald /dev/cua3 -f /etc/diald.local

>or by putting a "sleep 1" after your diald invocation.

>(Note that if you invoke diald early enough in your rc
>startup procedure, then you will never see this problem.
>This probably explains why this long present bug has not
>been reported until now.)

Thanks Eric for responding.  

Perhaps your explaination gives light to why some of my early attempts to
put my diald script in rc.local failed.  The modem lights would flicker
alittle bit like the script was going to work and then the process was
crippled and prevented me from connecting w/o killing the process all
together.

Currently two processes are started before the diald script and my diald
incantation is a little different from yours.  In rc.local I have

echo "Starting up diald..."
/etc/diald.1387

where diald.1387 is

#!/bin/sh
/etc/diald /dev/cua1 -m ppp \
 local 205.216.109.65 \
 remote 205.216.96.127 \
 defaultroute \
 modem \
 crtscts \
 up \
 connect "/etc/chat -v -f /etc/ppp_chat1"

which works flawlessly when executed from the command line manually.  I
am not sure what the setsid command does.  I don't use it to start innd
or httpd but maybe the absence of this command is also part of the reason
why the bootup script does not work in my case.

Any comment on this inference, Eric?

Thanks,

-Mike James

 
 
 

Automating pppd or diald startup after paower fail

Post by Mike Jam » Sat, 04 Nov 1995 04:00:00



Quote:

>Thanks Eric for responding.  

>Perhaps your explaination gives light to why some of my early attempts
to
>put my diald script in rc.local failed.  The modem lights would flicker
>alittle bit like the script was going to work and then the process was
>crippled and prevented me from connecting w/o killing the process all
>together.

>Currently two processes are started before the diald script and my diald
>incantation is a little different from yours.  In rc.local I have

>echo "Starting up diald..."
>/etc/diald.1387

>where diald.1387 is

>#!/bin/sh
>/etc/diald /dev/cua1 -m ppp \
> local 205.216.109.65 \
> remote 205.216.96.127 \
> defaultroute \
> modem \
> crtscts \
> up \
> connect "/etc/chat -v -f /etc/ppp_chat1"

>which works flawlessly when executed from the command line manually.  I
>am not sure what the setsid command does.  I don't use it to start innd
>or httpd but maybe the absence of this command is also part of the
reason
>why the bootup script does not work in my case.

>Any comment on this inference, Eric?

>Thanks,

>-Mike James

Just for the record, I solved my problem by reading between the lines in
Eric's first reply back that my diald version was suspect.  So I
downloaded diald v.0.11 from ftp.cc.gatech.edu and then got my script to
dial out from rc.local during bootup.

I modified my diald script ever so slightly in the first line below the
shell business.  After I compiled diald, I moved it to /usr/sbin.  So
instaed of

#!/bin/sh
/etc/diald /dev/cua1 -m ppp \

the diald script changed to

#!/bin/sh
/usr/sbin/diald /dev/cua1 -m ppp \

Now my network will come back up on-line automatically after a power fail
or I can make changes to the system remotely, reboot and verify whether
any changes I made to the system work.

 
 
 

Automating pppd or diald startup after paower fail

Post by Jim Ocke » Sun, 05 Nov 1995 04:00:00



: >Greetings folks,

: >I am new ISP and currently used the super nice diald script to maintain
: >my connection to the internet.  What I realized I need now is a way to
: >automatically initiate a ppp or diald script during bootup after after a
: >power fail occurs.

: >I understand you can do this either in the inittab or rc.local files but
: >am not sure how to implement the confiuration to start a ppp script and
: >have it respawn if the connection dies (likewise w/ diald).  I had some
: >help from some kind folks here before, but lost their messages (don't
: >know if an archive for this group exists either).

: Well, as far as diald is concerned, you should be able to just
: start diald in your rc.local file the same way you start it
: from the command line.

As you mentioned, you might just put pppd in your inittab so that init
keeps respawning pppd until it gets a connection, and if the link goes
down for whatever reason, including a reboot, then init will respawn it.

Just give it an identifier, runlevel(s), and a command line, like

d1:45:respawn:/usr/local/bin/pppd connect /where/ever/connect-script modem lock defaultroute noipdefault -detach crtscts /dev/ttyS5 38400

Seems like something like that ought to work.  That is the sort of command line
I use to connect via PPP to my ISP.

--

 
 
 

1. automating pppd via diald

I try to automate a connection to the Internet with pppd via diald.

First I'm starting diald as follows:
    /usr/sbin/diald /dev/cua0 -m ppp local 130.0.0.3 remote 130.0.0.2 \
    defaultroute modem crtscts connect "/etc/ppp/ppp-up" dynamic

/etc/ppp/ppp-up looks like this:
    /usr/sbin/pppd connect "/usr/sbin/chat -v -f /etc/ppp/ppp.chat"
defaultroute

This last script without diald works fine but if I start diald before pppd
then the SysLog says:
    ppp not replacing existing default route to sl0[130.0.0.2]

I'm not able to connect to any site in the Internet.
Is there someone who can help me ?

Torsten Hoellermann

2. tar question

3. Diald problems: pppd startup timed out

4. KDE/KPPP and IBM-Internet

5. diald/pppd: failed to set terminal attributes - DOES ANYBODY KNOW?

6. Accessing a shell script w/o doing . /script

7. diald/pppd: failed to set terminal attributes: Invalid argument

8. Root partition is XIA, can't boot

9. pppd works, diald fails initializing modem.

10. diald problem - pppd won't start from diald

11. pppd fails on startup

12. DIALD fails ppp-on fails ppp-go works HELP!!!

13. Automated Startup of Server (inittab?)