HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: bug: doesn't respond correctly to SIGTERM
Author: Tom Fernandes
Date: 02/27/2008 17:39
 
Hi again,

I actually "fixed" this by setting exit statuses differently:

--- httrack-3.42.1/src/httrack.c        2006-08-15 15:24:03.000000000 +0200
+++ /tmp/httrack.c      2008-02-27 17:36:02.000000000 +0100
@@ -659,7 +659,7 @@
 }
 static void sig_term( int code ) {       // quitter brutalement
   fprintf(stderr,"\nProgram terminated (signal %d)\n",code);
-  exit(0);
+  exit(143);
 }
 static void sig_finish( int code ) {       // finir et quitter
   signal(code,sig_term);  // quitter si encore
@@ -667,6 +667,7 @@
                global_opt->state.exit_xh=1;
        }
   fprintf(stderr,"\nExit requested to engine (signal %d)\n",code);
+  exit(143);
 }
 #ifdef _WIN32
 static void sig_ask( int code ) {        // demander

just in case somebody is interested. If this has any side-effects I'm not
aware of - pleas let me know.

cheers,


Tom


> Hi,
> 
> > > The first time it receives SIGTERM it says:
> > > "Exit requested to engine (signal 15)"
> > > but continues downloading. When giving it a
> > SIGERM
> > > again it dies with:
> > > "Program terminated (signal 15)"
> > 
> > > It seems also strange to me that you have to
> kill
> > it
> > > twice (via SIGTERM) until it dies.
> > 
> > WinHttrack does the same thing by design. The
> first
> > press of Cancel allows the currently downloading
> > files to complete and the cache to be updated
> > properly before exiting.
> > 
> > If you let it exit after the first signal it
> might
> > have given a proper status.
> 
> No - it still gives an exit status of 0 - even if I
> kill it only once (using SIGTERM) and let it finish.
> Using or disabling the cache (-C0) doesn't make a
> difference.
> 
> btw. I'm using 3.42.1-1 - debian version.
> 
> cheers,
> 
> 
> Tom

 
Reply Create subthread


All articles

Subject Author Date
bug: doesn't respond correctly to SIGTERM

02/27/2008 16:14
Re: bug: doesn't respond correctly to SIGTERM

02/27/2008 16:41
Re: bug: doesn't respond correctly to SIGTERM

02/27/2008 16:50
Re: bug: doesn't respond correctly to SIGTERM

02/27/2008 17:39




8

Created with FORUM 2.0.11