LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   To start ppp daemon from Linux (https://www.linuxquestions.org/questions/linux-networking-3/to-start-ppp-daemon-from-linux-205755/)

Pashmina 07-16-2004 05:28 AM

To start ppp daemon from Linux
 
I need to write a Java program to start ppp daemon from my Linux box. M program is not executing properly, it just waits at the prompt and after some time i get "java.net.ConnectException: Connection timed out". Is there any way of knowing actually whether ppp daemon has started?
Has anyone written code for this?

Through wvdial, sometimes ppp daemon dies, with various exit codes of 16, 10, 1 etc.

Any solution for this?

jailbait 07-16-2004 10:00 AM

"Through wvdial, sometimes ppp daemon dies, with various exit codes of 16, 10, 1 etc."

You can try puting this line in /etc/wvdial.conf
Stupid Mode = 1
Stupid Mode tells pppd to ignore minor errors in the connect protocol and continue on anyway.

"I need to write a Java program to start ppp daemon from my Linux box. M program is not executing properly, it just waits at the prompt and after some time i get "java.net.ConnectException: Connection timed out". Is there any way of knowing actually whether ppp daemon has started?"

If stupid mode works with wvdial then you can try passing the stupid mode parameter from your java program to pppd. I don't know how to specify this. You may have to set up stupid mode in one of the pppd files instead of passing it from java.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

Pashmina 07-23-2004 03:47 AM

Starting pppd (from linux) through Java, but connection timing out
 
Hi,
I am starting ppp daemon from Linux, through java. Am using the following:
Process p = r.exec("sudo /usr/sbin/pppd /dev/ttyG0_00 dump debug crtscts nolock 3.112.8.176:195.0.0.2");
After that i want to fire a URL and retrieve that data. But i get a "java.net.ConnectException: Connection timed out" when i try to read from the stream after opening a url connection.

In var/log/messages, I am getting the following:
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: pppd options in effect:
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: debug^I^I# (from command line)
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: dump^I^I# (from command line)
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: noauth^I^I# (from /etc/ppp/options)
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: /dev/ttyG0_00^I^I# (from command line)
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: nolock^I^I# (from command line)
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: crtscts^I^I# (from command line)
Jul 23 03:10:41 patrvlxcps01 pppd[10182]: 3.112.8.176:195.0.0.2^I^I# (from command line)
Jul 23 03:10:41 patrvlxcps01 pppd[10183]: pppd 2.4.1 started by root, uid 0
Jul 23 03:10:41 patrvlxcps01 pppd[10183]: Using interface ppp0
Jul 23 03:10:41 patrvlxcps01 pppd[10183]: Connect: ppp0 <--> /dev/ttyG0_00
Jul 23 03:11:13 patrvlxcps01 pppd[10183]: Hangup (SIGHUP)
Jul 23 03:11:13 patrvlxcps01 pppd[10183]: Modem hangup
Jul 23 03:11:13 patrvlxcps01 pppd[10183]: Connection terminated.
Jul 23 03:11:13 patrvlxcps01 kernel: dgdm: dgdm_tty_hangup(0_00_0): tty->count wierdness 2
Jul 23 03:11:14 patrvlxcps01 pppd[10183]: Exit.

By the above log, the ppp daemon is dying out and thus am not able to retrieve data from the stream.
Any idea why this could be happening. Do i need to change some settings?

Thanks,
Pashmina


All times are GMT -5. The time now is 04:21 PM.