USG 5.0 r2: can my program tell if it is in background/nohup'd?

R. Curtis Jackson rcj at burl.UUCP
Fri Aug 10 06:56:43 AEST 1984


Is there any way for me to make some test and see if I am running in
the background?  I have an assembler package that calls m4(1), runs
my own yacc/lex preprocessor, passes pseudocode onto a meta-assembler,
and conditionally calls a linkage editor.  I catch SIGINT because I
need to do tempfile cleanup, but when this package is run nohup'd in
the background and the user hits a delete or break in his login shell,
the interrupt punches through nohup (nohup does nothing with signal 2)
and kills the nohup'd process!!

This is not good.

These assemblies are large and may take 20 minutes.  Try not hitting
delete or break for 20 minutes on Unix and you'll see that this can
be both irritating and impossible.

Thanks for any help/pointers,
-- 

He gave the novice a long, icy stare and quietly growled, "RTFM".

The MAD Programmer -- 919-228-3313 (Cornet 291)
alias: Curtis Jackson	...![ ihnp4 ulysses cbosgd we13 ]!burl!rcj
			...![ ihnp4 cbosgd akgua masscomp ]!clyde!rcj



More information about the Comp.unix.wizards mailing list