LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-21-2009, 11:45 AM   #1
skipunda
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
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.
 
Old 12-21-2009, 12:46 PM   #2
David1357
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
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by skipunda View Post
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.
 
Old 12-22-2009, 09:40 AM   #3
dickgregory
Member
 
Registered: Oct 2002
Location: Houston
Distribution: Arch, PCLinuxOS, Mint
Posts: 257

Rep: Reputation: 34
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.
 
Old 12-22-2009, 09:55 AM   #4
skipunda
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Turns out the problem was thread related.

Thanks to all who replied because it was these replies that enabled me to solve the problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Gnome-main-menu (slab): can't run app-browser from terminal Rasmus Linux - Desktop 3 12-13-2009 12:30 PM
open multiple terminal shell runlevel 3 sunlinux Linux - General 4 04-07-2008 01:34 AM
How to close terminal window when launching app from command line Casket Linux - Newbie 8 11-02-2007 07:05 AM
Simple shell script to open up terminal and ssh to another machine deadseasquirrel Programming 1 02-02-2006 06:25 AM
How do I open a text editor in a shell terminal? alex1986 Linux - Newbie 9 11-30-2005 04:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:58 PM.

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