Find the answer to your Linux question:
Results 1 to 4 of 4
This is a pretty simple problem. I want to run two applications simultaneously from a script, and end both of them should either one or the script itself terminate. I'm ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2004
    Location
    New York
    Posts
    150

    Backgrounding in a script


    This is a pretty simple problem. I want to run two applications simultaneously from a script, and end both of them should either one or the script itself terminate. I'm just not sure what the proper method is - somehow using wait and kill doesn't seem like the ideal solution. The scripting resources I've found so far don't seem to address this kind of situation.

    [edit] Heck, I've made a thread, I might as well throw this question in too: Does anyone know how to start a screensaver from the command line - using KDE's system, not xscreensaver? I don't see any dcop calls for that, nor did I find any specific commands that manage the screensaver.
    \"Nifty News Fifty: When news breaks, we give you the pieces.\" - Sluggy Freelance

  2. #2
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    to run something in the background put a & after it like this:

    /monkey/cheese/something &

  3. #3
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Chd,India
    Posts
    135
    You can fork 2 children and run the 2 processes and in the main thread just wait for the threads to return.
    or you can establish an IPC connection between the 3 threads and should any one of them exit,the other 2 clean up and exit
    To ensure that a process is up and running you can send some sort of regresh signal with a timeout to which if the process does not respond,then assume it to have exited.

    Hope this helps you
    The strong shall live and the weak will die
    In the end,only the fittest survive in this world
    - Shishio Makoto

  4. #4
    Linux Newbie
    Join Date
    Nov 2004
    Location
    New York
    Posts
    150
    Thanks for the replies. I didn't realize it was that involved - all I wanted to do was glue a couple of lines together to play the flyingtoasters screensaver to the sound of Ride of the Valkyries upon command. Nevermind.
    \"Nifty News Fifty: When news breaks, we give you the pieces.\" - Sluggy Freelance

Posting Permissions

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