| PLEX86 | ||
|
fork off from shell scriptHi, how can I start some program from a shell script, and then exit the shell script without waiting for the child to finish, while the child program continues to run? The background is this: I'm using procmail to filter my mail and to notify me in some cases, among other things. The recipe is like this: # Deliver white-list * ? echo "$FROM" grep -i -f $PMDIR-white.lst { :0 { dummy = `newmail-notify` } :0: $DEFAULT } The 'newmail-notify' script plays a sound and runs kdialog to notify me of the new mail. Of course, knotify sits there until I click OK (just like it should). The only problem is that procmail has a 15 minute timeout, after which it kills 'newmail-notify' and thus kdialog. The notification disappears. That's not what I want, kdialog should be sitting there forever, until I click OK. So what I thought I could do was to start a "laucher" for 'newmail-notify' instead of 'newmail-notify' itself. The launcher should fork off the script to run independently, and then finish completely. Procmail should continue after the launcher finishes (i.e. right away) and no timeout should ever occur. However, in everything I tried, 'newmail-notify' somehow stayed connected to the launcher as a child process. Procmail always waits until 'newmail-notify' finishes too, so the timeout occurs again. new graphic card problem Run the command "vmstat 5", and let it run. Do some browsing. When you think the computer is slow, go back to the terminal window with vmstat, and hit Ctrl-C... I tried to implement the launcher with shell script and perl, and tried: 1) #!-bin-bash ~-bin-newmail-notify & A new reader Welcome to comp.os.linux.misc, read this first if you're new here FAQ 43 Netiquette 2005-12#1 New reader? Great! Welcome! Here's how to make best use of this newsgroup and get... This approach, running in the background, was unsuccessful. 2) #!-usr-bin-perl exec('~-bin-newmail-notify'); 3) #!-usr-bin-perl fork and exit; exec('~-bin-newmail-notify'); Both the perl approaches didn't work either, procmail always waits, and the timeout occures and kills the script. Does anyone have a suggestion on how to implement the launcher so that the child is not connected to the launcher, and the launcher exits cleanly? Many Thanks, So much for dd'ing video DVD I have a DVD home video that I copied from my mini-DV camcorder directly to a CD+RW in a console DVD recorder. The video plays fine, but when... Michael Goerz
|
||||
A new reader Welcome to comp.os.linux.misc, read this first if you're new here FAQ 43 Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||