Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-21-2009, 11:45 AM
|
#1
|
LQ Newbie
Registered: Dec 2009
Posts: 2
Rep:
|
Open new shell terminal to allow command entry without crashing main app
Hi All,
I am relatively new to linux (know enough to be dangerous!) and new to this forum.
What I am trying to do is open an interactive shell terminal so that process information can be obtained.
Currently, the software we are running contains debug/monitoring software. What I would like to do is exit out of the debug into a new shell terminal and enter commands such as cat/proc/meminfo without interrupting the main app that is running. I then would exit the shell with exit or control-d.
I have tried 'system("/bin/sh -i");' in the appropriate software file to get an interactive terminal. This opens up a new terminal, but unfortunately as soon as I press any key, the main app crashes and the following is received: [1]+ Stopped (SIGVTALRM) run.
I'm not sure what else I need to do to get this to work.
I hope this makes some sort of sense.
Any help and advice would be greatly appreciated.
Many thanks in advance.
|
|
|
12-21-2009, 12:46 PM
|
#2
|
Senior Member
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Rep:
|
Quote:
Originally Posted by skipunda
Currently, the software we are running contains debug/monitoring software. What I would like to do is exit out of the debug into a new shell terminal and enter commands such as cat/proc/meminfo without interrupting the main app that is running. I then would exit the shell with exit or control-d.
|
Why don't you just have the program itself execute the "cat /proc/meminfo"?
WARNING: Speculation follows:
It sounds like you are calling "system" in the same thread context as the "debug/monitoring" software, which may cause a timeout to expire and issue the SIGVTALARM. You might have better success making your call to "system" from another thread.
However, without a better understanding of how "the software we are running" and the "debug/monitoring software" interact, I am not sure I can help you. Do the two parts of the software run in the same execution thread? Maybe you could provide a little diagram or verbal description of the overall software architecture.
|
|
|
12-22-2009, 09:40 AM
|
#3
|
Member
Registered: Oct 2002
Location: Houston
Distribution: Arch, PCLinuxOS, Mint
Posts: 257
Rep:
|
Can you just log on to a virtual terminal and issue whatever commands you need? To get a VT login, just hit Shift-Alt-F1 and log in. To get back to your main app, assuming it is running in a GUI, hit Alt-F7.
Most distros have 6 VT's, accessed by Shift-Alt-F(n) where n = the VT # (1-6). VT 7 is usually your GUI session, but you can also bring up VT 8, VT 9, etc. with the switch user feature, usually accessed via the logout menu.
|
|
|
12-22-2009, 09:55 AM
|
#4
|
LQ Newbie
Registered: Dec 2009
Posts: 2
Original Poster
Rep:
|
Turns out the problem was thread related.
Thanks to all who replied because it was these replies that enabled me to solve the problem.
|
|
|
All times are GMT -5. The time now is 05:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|