Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I try to start a program on my linux server, but the program should start on the background. i typed: /map/map/theprogram & in the rc.local file but the program ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    1

    Starting a program on the background


    Hello,

    I try to start a program on my linux server,
    but the program should start on the background.
    i typed:
    /map/map/theprogram &
    in the rc.local file
    but the program only seems to work when it is opend in a screen so i made it:
    screen /map/map/theprogram &
    and thats the way it works.
    only the rest of the startup is going over the screen and isn't readable any more.

    so i want to find a way to start the program in a screen but on the background. or the screen should be closed again before the rest or the reboot.

    is there a way i can fix this?
    Im kind of new in linux so i hope you can help me out.
    thnx

  2. #2
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    When you close your window, a "HUP" signal is sent to any processes that it started which tells them to stop. If you do
    /path/to/file/script &

    It places the "script" into the backgroud of your current session, but when you close the window, it will receive the "HUP" signal and exit. What you want to do is to tell it to ignore the "HUP" signal and keep running. You can do this with:
    nohup /path/to/file/script &

    Now, when you close the window, it will keep running.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •