Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009
    Posts
    1

    Question Unanswered: Why my script is always "stopped" ?

    This is the problem that drives me crazy. I let a script A (a.sh) call script B (b.sh).
    I used
    Code:
     nohup a.sh &>/tmp/log &
    In script A it calls B directly, without any redirecting or nohup or background.

    Script A:
    Code:
    #do nothing but call B
    ssh another-machine "/user/tom/b.sh"
    Script B:
    Code:
    # do some fancy things, takes about 1 hour to finish
    ...
    I used
    Code:
    nohup a.sh &>/tmp/log &
    It was "stopped" after 5 minutes but B was running and B finished correctly.

    Anybody knows why?

    BTW, if I don't use nohup and backgrounding, it's OK. i.e. if I use
    Code:
    a.sh
    directly. Everything is OK. I am totally confused.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool Waiting..

    In nohup or background it is 'stopped' waiting for the ssh to complete.

    In foreground, it just 'waits' for a command (v.g break) from terminal input while waiting for ssh to complete.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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