View Full Version : background process switches to stopped
bonkey
11-19-2002, 08:44 AM
I am writting an application to log user input. Like the .sh_history file, but a single file that logs the username and a timestamp.
My problem is that when I put the program into the background, it immidiatly changes to STOPPED. I can then fg or bg to bring it into the forground or background.
If I bring it into the forground, it continues to run. If I put it into the background, it immediatly stops again.
Any ideas as to what is causing it to stop?
EDIT: Code Removed
bonkey
11-19-2002, 11:33 AM
I found out that information as well as I was studying the problem.
Is there a way to do what I want? Do I need to get the commands from the kernel before it runs the command? What options do I have?
bonkey
11-19-2002, 12:03 PM
How do I allow for advanced shell funtionality, like up arrow to retrieve previos commands? Won't that be lost be makeing a shell wrapper?
This was my original idea until I hit these limitations.
bonkey
11-20-2002, 08:27 AM
screw you!
I am not whining. I started with your pathetic idea. But it is severly flawed! Full shell functionality will not be maintined if a wrapper is used.
I posted this, in hopes that you would provide some support for your idea. But, to come back and say I'm whining and should read documentation?!?
I am looking to write a professional application, not some pewny app to run on my pc at home. This app will have to support over 50,000 users using a variety of shells, including user created shells.
My initial post way solely to find out why my backgrounded program would stop. I found that out before you posted. Oh, by the way, your explanation for that is ALSO WRONG! I was not reading from stdin, in fact went out of my way to avoid it by accessing the ty device directly. The end result is the same, but the semantics of why it doesn't work are very different.
While we are on the subject of documentation maybe you should read up on, SIGTTOU and SIGTTIN.
I guess the level of knowledge on this board is just not as high for the linux side as it is for c++ and windows. Too bad.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.