LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-28-2010, 01:23 AM   #1
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
Question Method to determine why a program immediately exits?


I'm trying to run pppd on an embedded machine and the application terminates immediately with no message, warning, or anything. It doesn't seem to have any print option and I'm scratching my head trying to find a clue as to why it did not want to run. I have a few suspicions as to why but I need evidence to confirm them. Is there any alternative means for determining why a program exited abruptly? I've tried looking at dmesg and saw nothing there.

I should also mention that this embedded system is very minimal (no build environment) and any software I install on it has to be cross compiled from another machine and the files copied over by hand. (I had to do this to put pppd on the system in the first place). Thanks for any advice you can give.
 
Old 12-28-2010, 01:32 AM   #2
soppy
Member
 
Registered: Mar 2008
Location: In your head!
Distribution: Arch Linux
Posts: 165
Blog Entries: 1

Rep: Reputation: 28
Quote:
Originally Posted by R00ts View Post
I'm trying to run pppd on an embedded machine and the application terminates immediately with no message, warning, or anything. It doesn't seem to have any print option and I'm scratching my head trying to find a clue as to why it did not want to run. I have a few suspicions as to why but I need evidence to confirm them. Is there any alternative means for determining why a program exited abruptly? I've tried looking at dmesg and saw nothing there.

I should also mention that this embedded system is very minimal (no build environment) and any software I install on it has to be cross compiled from another machine and the files copied over by hand. (I had to do this to put pppd on the system in the first place). Thanks for any advice you can give.
You should be able to ssh into it from another computer. Once there, run the program from the command prompt and note the output. I don't know what kind of device it is and I'm hoping that you can set-up some sort of ssh or connection between a PC and the device via USB or network. I apologize in advanced if this is just not possible, but it should be.
 
Old 12-28-2010, 04:00 AM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Check the error code it returns:
# pppd ......
# echo $?

If you've got strace on there, try running pppd through that to see what it's up to:
# strace pppd ......

Dave
 
Old 12-28-2010, 11:42 AM   #4
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Unfortunately no I don't have ssh access. The exit code pppd returns is 1 so its definitely not happy. Unfortunately no I don't have strace on this machine. I just had the idea to write the standard output and error to two files to see if it said something.

Code:
pppd -d > stdout.txt 2> stderr.txt
stderr.txt was empty, but the other file had a useful message:

"Couldn't set tty to PPP discipline: Invalid argument"


So hopefully that clue will help me find the problem. Thanks for the help guys.
 
Old 12-28-2010, 01:17 PM   #5
Samotnik
Member
 
Registered: Jun 2006
Location: Belarus
Distribution: Debian GNU/Linux testing/unstable
Posts: 471

Rep: Reputation: 40
You should make sure that your kernel supports PPPOE, PPPOX and PPP_ASYNC. If they are compiled as modules, make sure they are loaded.

Last edited by Samotnik; 12-28-2010 at 01:18 PM.
 
Old 12-29-2010, 12:50 PM   #6
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Samotnik View Post
You should make sure that your kernel supports PPPOE, PPPOX and PPP_ASYNC. If they are compiled as modules, make sure they are loaded.
Yeah that was the problem. I only had half of the kernel modules I needed loaded. Once I loaded the other two everything worked just fine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Method to determine if a device is a usb device (RHEL5 / RHEL6) mholden64 Linux - Kernel 4 08-15-2009 07:45 PM
best method to determine network devices in a script? agrestic Linux - Newbie 3 01-15-2009 05:15 AM
program exits with EBADF on a Socket read wkhoo Programming 6 12-11-2008 04:31 PM
Determine what encryption method is used jonlake Linux - General 1 09-27-2006 12:28 AM
how to determine if a program is running? iclinux Programming 10 02-04-2005 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration