Linux.com

meili100

meili100

  • Linux.com Member
  • Posts: 1
  • Member Since: 27 May 09
  • Last Logged In: 03 Jun 09

Latest Posts

Posted by
Topic
Post Preview
Posted
  • meili100
    Why my shell 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 &[/code] 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"[/code] Script B: [code]# do some fancy things, takes about 1 hour to finish ...[/code] I used [code]nohup a.sh &>/tmp/log &[/code] 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[/code] directly. Everything is OK. I am totally confused.
    Link to this post 27 May 09

    This is the problem that drives me crazy. I let a script A (a.sh) call script B (b.sh).
    I used

     nohup a.sh &>/tmp/log &

    In script A it calls B directly, without any redirecting or nohup or background.

    Script A:

    #do nothing but call B
    ssh another-machine "/user/tom/b.sh"

    Script B:

    # do some fancy things, takes about 1 hour to finish
    ...

    I used

    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

    a.sh

    directly. Everything is OK. I am totally confused.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board