[Varnish] #1794: varnish*-tools do not die when terminal disconnects

Varnish varnish-bugs at varnish-cache.org
Fri Oct 2 16:31:42 CEST 2015


#1794: varnish*-tools do not die when terminal disconnects
--------------------+--------------------
 Reporter:  kwy     |       Owner:
     Type:  defect  |      Status:  new
 Priority:  normal  |   Milestone:
Component:  build   |     Version:  4.0.3
 Severity:  normal  |  Resolution:
 Keywords:          |
--------------------+--------------------

Comment (by lkarsten):

 This is most likely related to there being no sighup handler defined.

 Following patch removes the behavior for me:

 {{{
 diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
 index 310eccc..d40264f 100644
 --- a/bin/varnishhist/varnishhist.c
 +++ b/bin/varnishhist/varnishhist.c
 @@ -133,6 +133,12 @@ profiles[] = {

  static struct profile *active_profile;

 +static int __match_proto__(VUT_cb_f)
 +sighup_handler(void)
 +{
 +       exit(1);
 +}
 +
  static void
  update(void)
  {
 @@ -464,6 +470,7 @@ main(int argc, char **argv)
                 exit(1);
         }
         VUT.dispatch_f = &accumulate;
 +       VUT.sighup_f = &sighup_handler;
         VUT.dispatch_priv = NULL;
         VUT_Main();
         end_of_file = 1;
 }}}

 Downside is that we don't clean up what curses has done, so the terminal
 becomes garbled if it still exists. ("reset" fixes, of course)

 Same sitation on varnishtop.

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1794#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list