tanya@adds.newyork.NCR.COM (Tanya Katz) (04/04/89)
The problem stated in: article <17168@cisunx.UUCP> by (James C. Benz) reminded me of a problem I noticed with ksh on my 3b1. >I have been trying to write a shell script that invokes a home-brew demon >process for an application I've been working on. On other Unix systems >I've worked on, (3B2) the nohup command allows you to log out of the >current shell level without killing the nohuped process. My shell script >on the UNIXPC has a line that goes something like this: > >nohup demon options 1>/dev/null 2>/dev/null& > ... If I put a program in the background, and do something else, and then type an interrupt from the keyboard (set to ctrl-c in my shell) the background process is interrupted too, and unless it was written to explicitly ignore interrupts, the background process exits. This happens when I enter command & from the ksh prompt. Shouldn't the shell be trapping those interrupts generated from the keyboard? Have I got something set up wrong somewhere?? Anyone else notice this? Tanya ------------------------------------------------------------------------------ ### ###### ###### ##### Tanya Katz (516) 231-5400 x430 # # # # # # # # # # # # # ##### ...uunet!ncrlnk!adds!tanya ####### # # # # # tanya.katz@adds.newyork.ncr.com # # ###### ###### ##### Applied Digital Data Systems, Inc. 100 Marcus Blvd., Hauppauge, NY 11788 ------------------------------------------------------------------------------
thk@uxrd14.UUCP (Tom Kiermaier) (04/11/89)
Use the setpgrp() system call to disassociate the daemon process from your tty. This will prevent the interrupts from reaching the process.