Thread: background process switches to stopped

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    170

    Angry background process switches to stopped

    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
    Last edited by bonkey; 11-20-2002 at 08:36 AM.
    Best Regards,

    Bonkey

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    170
    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?
    Best Regards,

    Bonkey

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    170
    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.
    Best Regards,

    Bonkey

  4. #4
    Registered User
    Join Date
    Aug 2002
    Posts
    170
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  2. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 01:43 AM
  3. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM
  4. Linux: Send keyboard input to background process
    By xErath in forum Tech Board
    Replies: 2
    Last Post: 12-09-2004, 07:02 PM
  5. Detect Close of a background process
    By Schwarzhelm in forum C Programming
    Replies: 1
    Last Post: 11-05-2003, 01:46 AM