problems with nohup

problems with nohup

Post by Kem » Tue, 04 Jan 2000 04:00:00



I am running a program with
    nohup myprogram
but when I close terminal, program dead.... any idea.... why?
thx.
-----------------------------------------------------------
Fermin Serrano Pozo

Madrid (Spain)
-----------------------------------------------------------
 
 
 

problems with nohup

Post by unil.. » Tue, 04 Jan 2000 04:00:00



> I am running a program with
>     nohup myprogram
> but when I close terminal, program dead.... any idea.... why?

Perhaps a daemon is cleaning up processes from dead terminals?
(this would happen on shell accounts which deny background bots)

Otherwise, what exactly is your program trying to do? What is
the minimal source code that fails? Can you 'nohup' a program
like " main(){ while(1); } " properly?

 
 
 

problems with nohup

Post by Kenneth C Stah » Tue, 04 Jan 2000 04:00:00



> I am running a program with
>     nohup myprogram
> but when I close terminal, program dead.... any idea.... why?
> thx.
> -----------------------------------------------------------
> Fermin Serrano Pozo

> Madrid (Spain)
> -----------------------------------------------------------

One thing you might try is running the program as an "at" job. That way it
is guaranteed not to have a controlling terminal.

If you can rewrite the program, you can make it run as a quasi-deamon and
thereby assure that its parent pid is 1 rather than the pid of your shell.

 
 
 

problems with nohup

Post by Pieter Winte » Tue, 04 Jan 2000 04:00:00



> I am running a program with
>     nohup myprogram
> but when I close terminal, program dead.... any idea.... why?
> thx.
> -----------------------------------------------------------
> Fermin Serrano Pozo

> Madrid (Spain)
> -----------------------------------------------------------

What I sometimes do is the following:

1.    Write a script myscript that contains the setpgrp command:
        setpgrp mycommands
2.    call nohup:
        nohup myscript &
3.    Exit the shell:
        exit

This seems to work for me. I haven't been able to get it to work another
way.

Hope this helps.

Pieter

 
 
 

problems with nohup

Post by Kem » Tue, 04 Jan 2000 04:00:00


I have solved it......
When I closed terminal, OS was sending singal 'SIGTSTP' to my program.
('man -s7I termio' and read why OS send this signal sometimes...). Now I
write:
        sigignore(SIGTSTP);
        sigignore(SIGTTIN);
        sigignore(SIGTTOU);
        sigignore(SIGHUP);
and my program "automaticaly" ignores signal from "terminal ending", so I do
not write 'nohup myprogram', only is neccesary now 'program'. This way cause
me the possibility of input data from stdin and read the stdout of my
program before run it....
Thx...



> I am running a program with
>     nohup myprogram
> but when I close terminal, program dead.... any idea.... why?
> thx.
> -----------------------------------------------------------
> Fermin Serrano Pozo

> Madrid (Spain)
> -----------------------------------------------------------

 
 
 

problems with nohup

Post by Kem » Tue, 04 Jan 2000 04:00:00


I have solved it......
When I closed terminal, OS was sending singal 'SIGTSTP' to my program.
('man -s7I termio' and read why OS send this signal sometimes...). Now I
write:
        sigignore(SIGTSTP);
        sigignore(SIGTTIN);
        sigignore(SIGTTOU);
        sigignore(SIGHUP);
and my program "automaticaly" ignores signal from "terminal ending", so I do
not write 'nohup myprogram', only is neccesary now 'program'. This way cause
me the possibility of input data from stdin and read the stdout of my
program before run it....
Thx...

I have other server that when I close terminal, it still running (I run it
with nohup)



> > I am running a program with
> >     nohup myprogram
> > but when I close terminal, program dead.... any idea.... why?
> Perhaps a daemon is cleaning up processes from dead terminals?
> (this would happen on shell accounts which deny background bots)

> Otherwise, what exactly is your program trying to do? What is
> the minimal source code that fails? Can you 'nohup' a program
> like " main(){ while(1); } " properly?

 
 
 

1. Problem with nohup myfile &

Platform ksh on Solaris ...

I have a script with the following

<do some other stuff, then>
cp JCpy_skeleton.properties JCpy_run2.properties
ed - JCpy_run2.properties <<EOM

        g/xxx/s/xxx/$SRCDB/g
        g/yyy/s/yyy/$TGTDB/g
        w
        q
EOM
nohup run_eds_batch.sh $SRCDB $TGTDB &
exit

My problem is that I have to hit 'enter' to get a system prompt back
after the nohup.  Running it with a 'set -x' produces the following:

======== begin screen log =======
+ cp JCpy_skeleton.properties JCpy_run2.properties
+ ed - JCpy_run2.properties
+ 0<<

        g/xxx/s/xxx/CMPM1240/g
        g/yyy/s/yyy/CMQM1240/g
        w
        q
+ exit
+ nohup run_eds_batch.sh CMPM1240 CMQM1240
$ Sending output to nohup.out

$
======== end screen log =======

That blank line between "Sending output to nohup.out" and the next
command prompt is where it was waiting for me to hit 'enter'.  I
thought the '&' at the end of the nohup command prevented that.

Thanks.

- Ed Stevens

Cohn's Law: The more time you spend in reporting on what you are doing, the less time you have to do anything. Stability is achieved when you spend all your time doing nothing but reporting on the nothing you are doing.

2. Problem with Printer Interface on Sco Unix 3.2

3. Problem with nohup jobs dying

4. FAQ uder OSR5

5. Problem about nohup!!!

6. gnus problem

7. Problem with nohup under AIX 5L

8. mouse problem with red hat 7.1

9. Problems using nohup command

10. Problem with Nohup and no control terminal

11. Problem with nohup in z-shell (zsh)

12. Problems with nohup and remsh

13. Problem w/nohup and mksysb