Discussion:
Disconnection command?
(too old to reply)
Rodolfo Medina
2006-04-19 11:31:29 UTC
Permalink
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
Instead, other Linux distributions don't have 'pon' and 'poff':
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.

Can you please suggest the suitable command to disconnect?

Thanks,
Rodolfo
Unruh
2006-04-19 16:02:22 UTC
Permalink
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
Can you please suggest the suitable command to disconnect?
killall pppd
Post by Rodolfo Medina
Thanks,
Rodolfo
Lew Pitcher
2006-04-20 02:01:18 UTC
Permalink
Post by Unruh
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
Can you please suggest the suitable command to disconnect?
killall pppd
I'll be /really/ pedantic and say...

For ppp0
kill SIGHUP `cat /var/run/ppp0.pid`

For ppp1
kill SIGHUP `cat /var/run/ppp1.pid`

etc

FWIW, you can substitute -SIGTERM or -SIGINT for -SIGHUP



- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
Rodolfo Medina
2006-04-20 13:34:57 UTC
Permalink
Post by Lew Pitcher
Post by Unruh
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
Can you please suggest the suitable command to disconnect?
killall pppd
I'll be /really/ pedantic and say...
For ppp0
kill SIGHUP `cat /var/run/ppp0.pid`
For ppp1
kill SIGHUP `cat /var/run/ppp1.pid`
etc
FWIW, you can substitute -SIGTERM or -SIGINT for -SIGHUP
Thanks: but on my system there's no file named ppp*.pid.
Cheers,
Rodolfo
Unruh
2006-04-20 18:20:30 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by Unruh
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
Can you please suggest the suitable command to disconnect?
killall pppd
I'll be /really/ pedantic and say...
For ppp0
kill SIGHUP `cat /var/run/ppp0.pid`
For ppp1
kill SIGHUP `cat /var/run/ppp1.pid`
If you have many instances of pppd running then sure, do it this way. If
not, killall pppd works just fine, and is certainly easier than your way.

I have never had call to have more than one instance-- since if I have one,
I have a connection to the net, and that is all I need.
But others may have more than one.
etc
FWIW, you can substitute -SIGTERM or -SIGINT for -SIGHUP
- --
Lew Pitcher
Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFERutuagVFX4UWr64RAmKIAKCGW4D39E3j4g6Gviih8rM2Wd5NIACeNGIQ
Ch4w9KB+Lc0T4VKKigztEG0=
=VtNv
-----END PGP SIGNATURE-----
Moe Trin
2006-04-20 00:41:32 UTC
Permalink
On Wed, 19 Apr 2006, in the Usenet newsgroup comp.protocols.ppp, in article
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
Yes, that's a Debian application.
Post by Rodolfo Medina
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
If you have access to that console/terminal where you ran that command
and it is _running_ the pppd daemon (no command prompt), then pressing
the left Ctrl and C keys will stop the session.

If you ran that 'pppd call my_provider' and the command prompt returns
so that you can do other things while the call is in progress, then
you can disconnect using

killall -TERM pppd

Old guy
Rodolfo Medina
2006-04-20 13:32:28 UTC
Permalink
Post by Unruh
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
Can you please suggest the suitable command to disconnect?
killall pppd
Thanks, it works, but only under Debian; instead, with Mandrake 10.1,
if I close the connection with 'killall pppd', when I try to start it again
I get the following output:

Apr 20 13:50:31 localhost pppd[4211]: pppd 2.4.2 started by root, uid 0
Apr 20 13:50:32 localhost chat[4212]: abort on (BUSY)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO CARRIER)
Apr 20 13:50:32 localhost chat[4212]: abort on (VOICE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIALTONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIAL TONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO ANSWER)
Apr 20 13:50:32 localhost chat[4212]: abort on (DELAYED)
Apr 20 13:50:32 localhost chat[4212]: send (ATZ^M)
Apr 20 13:50:32 localhost chat[4212]: expect (OK)
Apr 20 13:51:17 localhost chat[4212]: alarm
Apr 20 13:51:17 localhost chat[4212]: send (AT^M)
Apr 20 13:51:17 localhost chat[4212]: expect (OK)
Apr 20 13:52:02 localhost chat[4212]: alarm
Apr 20 13:52:02 localhost chat[4212]: Failed
Apr 20 13:52:02 localhost pppd[4211]: Connect script failed
Apr 20 13:52:03 localhost pppd[4211]: Exit.

. Then I have to switch off the phone and switch it on again, and then it
works.
Unfortunately I have to use Mandrake because I don't know how to
install Emacs cvs and Gnus cvs under Debian yet.

Any suggestion?
Cheers,
Rodolfo
Unruh
2006-04-20 18:23:30 UTC
Permalink
Post by Rodolfo Medina
Post by Unruh
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
Can you please suggest the suitable command to disconnect?
killall pppd
Thanks, it works, but only under Debian; instead, with Mandrake 10.1,
if I close the connection with 'killall pppd', when I try to start it again
That appears to be a problem with your serial line.
Post by Rodolfo Medina
Apr 20 13:50:31 localhost pppd[4211]: pppd 2.4.2 started by root, uid 0
Apr 20 13:50:32 localhost chat[4212]: abort on (BUSY)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO CARRIER)
Apr 20 13:50:32 localhost chat[4212]: abort on (VOICE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIALTONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIAL TONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO ANSWER)
Apr 20 13:50:32 localhost chat[4212]: abort on (DELAYED)
Apr 20 13:50:32 localhost chat[4212]: send (ATZ^M)
Apr 20 13:50:32 localhost chat[4212]: expect (OK)
Apr 20 13:51:17 localhost chat[4212]: alarm
Apr 20 13:51:17 localhost chat[4212]: send (AT^M)
Apr 20 13:51:17 localhost chat[4212]: expect (OK)
Apr 20 13:52:02 localhost chat[4212]: alarm
Apr 20 13:52:02 localhost chat[4212]: Failed
Apr 20 13:52:02 localhost pppd[4211]: Connect script failed
Apr 20 13:52:03 localhost pppd[4211]: Exit.
. Then I have to switch off the phone and switch it on again, and then it
works.
Switch off the phone? Is this one of those attrocious gsm modems?

Also are you sure you are not doing
killall -9 pppd
That does not allow pppd to clean up after itself.

You could also put something into /etc/ppp/ipdown to reset the modem.
Somehow it is not resetting itself when it gets the hangup signal.
You might look in /etc/ppp/ifdown in debian to see if they have some
special script in there.
Post by Rodolfo Medina
Unfortunately I have to use Mandrake because I don't know how to
install Emacs cvs and Gnus cvs under Debian yet.
Any suggestion?
Cheers,
Rodolfo
Rodolfo Medina
2006-04-21 16:16:45 UTC
Permalink
Post by Unruh
Post by Rodolfo Medina
. Then I have to switch off the phone and switch it on again, and then it
works.
Switch off the phone? Is this one of those attrocious gsm modems?
Why do you call them that? Bad quality?
But they are very useful, even necessary when you're travelling.

Cheers,
Rodolfo
Unruh
2006-04-21 17:27:06 UTC
Permalink
Post by Rodolfo Medina
Post by Unruh
Post by Rodolfo Medina
. Then I have to switch off the phone and switch it on again, and then it
works.
Switch off the phone? Is this one of those attrocious gsm modems?
Why do you call them that? Bad quality?
But they are very useful, even necessary when you're travelling.
The quality of their implimentation of ppp and of their abilities as a
modem leave much to be desired, as you are discovering.
I assume that you really meant that paragraph to start with
"Yes, it is."


It looks to me like you will need to put something into /etc/ppp/ipdown to
reset the modem/phone before you completely shut down. Eg use chat to send
it a hangup command?
Post by Rodolfo Medina
Cheers,
Rodolfo
Rodolfo Medina
2006-04-22 08:43:17 UTC
Permalink
Post by Unruh
Switch off the phone? Is this one of those attrocious gsm modems?
It's a Motorola c350 and a Nokia 6630.
Post by Unruh
The quality of their implimentation of ppp and of their abilities as a
modem leave much to be desired, as you are discovering.
I see, but since I was on travel in the last months and will be in the
next, I need using them.
Post by Unruh
It looks to me like you will need to put something into /etc/ppp/ipdown to
reset the modem/phone before you completely shut down. Eg use chat to send
it a hangup command?
I replaced the '/etc/ppp/ip-down' that is in Mandrake
with the one that is in Debian, but the problem remained:
strange, because with Debian the problem does not arise.

Cheers,
Rodolfo
Rodolfo Medina
2006-04-20 13:33:49 UTC
Permalink
On Wed, 19 Apr 2006, in the Usenet newsgroup comp.protocols.ppp,
Post by Moe Trin
Post by Rodolfo Medina
Under Gnu/Debian Linux, to connect and disconnect I use the commands
'pon' and 'poff' respectively.
then I connect with 'pppd call my_provider', but don't
know how to disconnect apart from switching off the phone.
If you have access to that console/terminal where you ran that command
and it is _running_ the pppd daemon (no command prompt), then pressing
the left Ctrl and C keys will stop the session.
No, I run that 'pppd call my_provider' and the command prompt returns
so that I can do other things while the call is in progress:
on another console I get the pppd output after I did:
$ tail -f /var/log/pppd
. But I wish instead to do as you say:
get the pppd output on the same console where I did
'pppd call my_provider', and then close connection simpy with 'C-c'.
Can you suggest how to do so?
Post by Moe Trin
If you ran that 'pppd call my_provider' and the command prompt returns
so that you can do other things while the call is in progress, then
you can disconnect using
killall -TERM pppd
Thanks: but 'killall pppd' only works under Debian; instead,
with Mandrake 10.1,
if I close the connection with 'killall pppd',
or also with 'killall -TERM pppd', when I try to start it again
I get the following output:

Apr 20 13:50:31 localhost pppd[4211]: pppd 2.4.2 started by root, uid 0
Apr 20 13:50:32 localhost chat[4212]: abort on (BUSY)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO CARRIER)
Apr 20 13:50:32 localhost chat[4212]: abort on (VOICE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIALTONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIAL TONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO ANSWER)
Apr 20 13:50:32 localhost chat[4212]: abort on (DELAYED)
Apr 20 13:50:32 localhost chat[4212]: send (ATZ^M)
Apr 20 13:50:32 localhost chat[4212]: expect (OK)
Apr 20 13:51:17 localhost chat[4212]: alarm
Apr 20 13:51:17 localhost chat[4212]: send (AT^M)
Apr 20 13:51:17 localhost chat[4212]: expect (OK)
Apr 20 13:52:02 localhost chat[4212]: alarm
Apr 20 13:52:02 localhost chat[4212]: Failed
Apr 20 13:52:02 localhost pppd[4211]: Connect script failed
Apr 20 13:52:03 localhost pppd[4211]: Exit.

. Then I have to switch off the phone and switch it on again, and then it
works.
Unfortunately I have to use Mandrake because I don't know how to install
Emacs cvs and Gnus cvs under Debian yet.

Any suggestion?
Cheers,
Rodolfo
Moe Trin
2006-04-21 00:34:22 UTC
Permalink
On Thu, 20 Apr 2006, in the Usenet newsgroup comp.protocols.ppp, in article
Post by Rodolfo Medina
Post by Moe Trin
If you have access to that console/terminal where you ran that command
and it is _running_ the pppd daemon (no command prompt), then pressing
the left Ctrl and C keys will stop the session.
No, I run that 'pppd call my_provider' and the command prompt returns
$ tail -f /var/log/pppd
get the pppd output on the same console where I did
'pppd call my_provider', and then close connection simpy with 'C-c'.
Can you suggest how to do so?
The 'tail -f /var/log/pppd; command is only getting what you told pppd
to put into that file - probable with the debug command and -v option to
chat. Without those options, pppd puts very little (if any) information to
the dialin terminal. Hmmm, had to look for a terminal that I've used
ppp in:

[compton ~]$ dialin454
ppp link connected to XXXXXX
[compton ~]$

Here, I used one of my dialin scripts, and the only thing seen is a message
I had /etc/ppp/ip-up create. No call progress, no dialer dialog - nothing.

I suspect you can add the option 'nodetach' to the file
/etc/ppp/peers/my_provider to cause the pppd not to have the terminal prompt
return immediately (which is the default from the command line).
Post by Rodolfo Medina
Thanks: but 'killall pppd' only works under Debian;
It's disconnecting under mandrake, so it is working. You have another problem.
Post by Rodolfo Medina
Apr 20 13:50:32 localhost chat[4212]: abort on (BUSY)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO CARRIER)
Apr 20 13:50:32 localhost chat[4212]: abort on (VOICE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIALTONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO DIAL TONE)
Apr 20 13:50:32 localhost chat[4212]: abort on (NO ANSWER)
Apr 20 13:50:32 localhost chat[4212]: abort on (DELAYED)
Does your modem know how to say all of those things? Most do not.
Post by Rodolfo Medina
Apr 20 13:50:32 localhost chat[4212]: send (ATZ^M)
Apr 20 13:50:32 localhost chat[4212]: expect (OK)
Please check the modem manual, and verify that is the recommended init
string. Under the Hayes command set, ATZ resets the modem to "some"
saved condition. In this case, it is not providing return codes, so
chat has no means of seeing what the modem is doing.
Post by Rodolfo Medina
Apr 20 13:51:17 localhost chat[4212]: send (AT^M)
Apr 20 13:51:17 localhost chat[4212]: expect (OK)
Even less useful. "I am going to send you a command", and you send none.
Post by Rodolfo Medina
. Then I have to switch off the phone and switch it on again, and then it
works.
When you "power cycle" the modem, you are setting it to the factory defaults,
and chat is able to talk to the modem.
Post by Rodolfo Medina
Unfortunately I have to use Mandrake because I don't know how to install
Emacs cvs and Gnus cvs under Debian yet.
I would expect CVS files to be used in the same manner in both systems,
but you might have found a CVS in rpm format, which is unusual.
Post by Rodolfo Medina
Thanks: but on my system there's no file named ppp*.pid.
After pppd is up and running, it should create that file. When pppd
shuts down, it removes the file. Thus, you would only find it while pppd
is running. It's described in the man page.

Old guy
Rodolfo Medina
2006-04-21 16:18:16 UTC
Permalink
Post by Moe Trin
I run 'pppd call my_provider' and the command prompt returns
$ tail -f /var/log/pppd
get the pppd output on the same console where I did
'pppd call my_provider', and then close connection simpy with 'C-c'.
Can you suggest how to do so?
I suspect you can add the option 'nodetach' to the file
/etc/ppp/peers/my_provider to cause the pppd not to have the terminal prompt
return immediately (which is the default from the command line).
Thanks:
The option 'nodetach' seems to be fine. Now, in Debian I do:

$ tail -f /var/log/pppd | pon my_provider

and it happens what I want, i.e.:
1) the output is given in the same console where I gave the connection command;
2) I can stop connection with 'C-c'.
Only, the output begins to come out after a while, so its first part is lost.
How can I improve all that? It was the same with:

$ tail -f /var/log/pppd && pon my_provider
Post by Moe Trin
Unfortunately I have to use Mandrake because I don't know how to install
Emacs cvs and Gnus cvs under Debian yet.
I would expect CVS files to be used in the same manner in both systems,
but you might have found a CVS in rpm format, which is unusual.
No, no cvs in rmp format.
It's only that debian is much more user-difficult than mandrake.

Cheers,
Rodolfo
Unruh
2006-04-21 17:33:58 UTC
Permalink
Post by Rodolfo Medina
Post by Moe Trin
I run 'pppd call my_provider' and the command prompt returns
$ tail -f /var/log/pppd
get the pppd output on the same console where I did
'pppd call my_provider', and then close connection simpy with 'C-c'.
Can you suggest how to do so?
I think this is a terrible solution. ^C does nothing except send the
program a kill signal. Ie, it is absolutely no different from using
killall, and you have a terminal used up and messed up with that program
Post by Rodolfo Medina
Post by Moe Trin
I suspect you can add the option 'nodetach' to the file
/etc/ppp/peers/my_provider to cause the pppd not to have the terminal prompt
return immediately (which is the default from the command line).
Again, except maybe for debugging purposes I see no point to this.
Post by Rodolfo Medina
$ tail -f /var/log/pppd | pon my_provider
Why in the world would you pipe the output of tail into the program pon?
Makes no sense to me.
Post by Rodolfo Medina
1) the output is given in the same console where I gave the connection command;
Why is that an advantage.
Post by Rodolfo Medina
2) I can stop connection with 'C-c'.
Why is that an advantage? Are your typing skills that bad?
Post by Rodolfo Medina
Only, the output begins to come out after a while, so its first part is lost.
$ tail -f /var/log/pppd && pon my_provider
This makes more sense. However, I do not know what you mean by "the first
part" Do you mean the chat stuff? You probably forgot to tell chat to send
stuff to /var/log/pppd ( chat uses local2 not daemon as the log facility)
Post by Rodolfo Medina
Post by Moe Trin
Unfortunately I have to use Mandrake because I don't know how to install
Emacs cvs and Gnus cvs under Debian yet.
I would expect CVS files to be used in the same manner in both systems,
but you might have found a CVS in rpm format, which is unusual.
No, no cvs in rmp format.
It's only that debian is much more user-difficult than mandrake.
Rodolfo Medina
2006-04-22 08:43:58 UTC
Permalink
Post by Unruh
Post by Rodolfo Medina
$ tail -f /var/log/pppd && pon my_provider
Only, the output begins to come out after a while, so its first part is lost.
How can I improve all that?
This makes more sense. However, I do not know what you mean by "the first
part" Do you mean the chat stuff? You probably forgot to tell chat to send
stuff to /var/log/pppd ( chat uses local2 not daemon as the log facility)
But if I do 'tail -f /var/log/pppd' and 'pon my_provider' on two different
terminals, in the first one I get *all* the output, included the chat stuff.


Cheers,
Rodolfo
Unruh
2006-04-23 15:39:21 UTC
Permalink
Post by Rodolfo Medina
Post by Unruh
Post by Rodolfo Medina
$ tail -f /var/log/pppd && pon my_provider
Only, the output begins to come out after a while, so its first part is lost.
How can I improve all that?
This makes more sense. However, I do not know what you mean by "the first
part" Do you mean the chat stuff? You probably forgot to tell chat to send
stuff to /var/log/pppd ( chat uses local2 not daemon as the log facility)
But if I do 'tail -f /var/log/pppd' and 'pon my_provider' on two different
terminals, in the first one I get *all* the output, included the chat stuff.
Well, then, do that.

You might want to track down why the other does not work as an intellectual
exercise, but it sounds like a waste of time to me.
Post by Rodolfo Medina
Cheers,
Rodolfo
Rodolfo Medina
2006-06-28 21:25:57 UTC
Permalink
Post by Rodolfo Medina
Post by Moe Trin
If you have access to that console/terminal where you ran that command
and it is _running_ the pppd daemon (no command prompt), then pressing
the left Ctrl and C keys will stop the session.
No, I run that 'pppd call my_provider' and the command prompt returns
$ tail -f /var/log/pppd
get the pppd output on the same console where I did
'pppd call my_provider', and then close connection simpy with 'C-c'.
Can you suggest how to do so?
All I needed was:
in the file `/etc/ppp/peers/my_provider' put the `debug' and `nodetach'
options and edit the chat line like this:

connect "/usr/sbin/chat -v -s -f /etc/chatscripts/my_provider"

or also like this:

connect "/usr/sbin/chat -e -f /etc/chatscripts/my_provider"

. Bye,
Rodolfo

Loading...