On Sat, 24 Oct 1998, Stephen Davies wrote:

> Can anyone please explain why pppd might use ppp1 instead of ppp0 and better 

Because ppp devices are dynamically allocated as PPP line disciplines are
installed on tty devices. When pppd starts up, it opens the /dev/tty*
devic ethat it is told to use and then issues a special system call to install
the PPP discipline on that tty. The ppp line discipline driver immediately
kicks into action creates a network device called pppX, where X is the lowest
number that is not currently in use.  The pppX device will be released when the
PPP line discipline on its corresponding tty device is removed; its name will
then be available for reuse.  This happens when the corresponding pppd daemon
exits. Even if the daemon is forcibly terminated, the line discpline should be
restored back to normal as the tty device is closed.  (But if some other
process is holding the tty open, the line discipline and hence the ppp device
WON'T be released until the last process closes the tty!)

Perhaps there is a race condition in your setup. I don't know how diald
manages the pppd processes that it launches; but if the pppd sessions are
detached, they are collected by init rather than whatever process launched
them. [[ By deafult, pppd sets itself up as a deamon: it forks a child clone of
itself and then terminates the parent. This means that the init deamon becomes
the surrogate parent of that child. When pppd exits, it is init that will be
notified, not the parent such as diald. The -detach option of pppd disables
this detaching, so that pppd stays with its parent. ]]

Try not giving pppd a chance to do a graceful exit: use ``kill -KILL'' (the
same as -9) so that diald can't get the impression that the network is down
before the tty device is closed. If you kill the processes with -TERM, you are
giving them a chance to perform some activities before they exit. The pppd
daemon doesn't simply close the terminal device when it exits gracefully; it
proceeds in steps, by first hanging up by dropping DTR, etc. When it's doing
this, it's perhaps possible that the diald will launch another pppd.  (I don't
have the source code for diald handy, but I could investigate more deeply, if
you want).

> I guess another alternative is to somehow automatically rebuild my firewall 
> rules.

Why do your firewall rules have to depend on whether your device is ppp0 or
ppp1?  First of all, does your ``permantent'' connection have a static or
dynamic IP?

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to