[SOLVED] Open new shell terminal to allow command entry without crashing main app
Linux - NewbieThis 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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.