> No, you can use an external wrapper command. If you use Linux, the
> util-linux package has the "setsid" command.
Yes, but:
1) the "setsid" command doesn't exist on every unix system.
Ex: solaris 2.6 2.8, OSF1 V4.0
2) you cannot give the "setsid" command a bash function as argument.
> Also, my idtools package has the "setstate" command:
> <URL:http://multivac.cwru.edu./idtools/>.
I'll have a look. Thanks.
> > exec_with_timeout () {
> This code works for me without setpgid.
Only if you call it directly from a login shell in monitor mode. In
this case the two background processes are effectively put in a
separate process group. This will not be the case otherwise, and you
will not be able to kill eventual child processes.
Francis
PS: the watchdog was incorrect in my example. It should be:
( sleep $timeout; kill -TERM -$pid; sleep 5; kill -KILL -$pid ) &