[master] d52425ff8 varnishadm: do not ignore SIGTERM/SIGINT for interactive&pass mode

Nils Goroll nils.goroll at uplex.de
Wed Feb 26 14:05:06 UTC 2020


commit d52425ff8d8a8528cf43233779ae7ab7efd193b0
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Feb 26 15:04:18 2020 +0100

    varnishadm: do not ignore SIGTERM/SIGINT for interactive&pass mode
    
    fixes #3229

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index ba8797c7c..f93ace25d 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -467,9 +467,6 @@ main(int argc, char * const *argv)
 	argc -= optind;
 	argv += optind;
 
-	VSIG_Arm_int();
-	VSIG_Arm_term();
-
 	if (T_arg != NULL) {
 		if (n_arg != NULL)
 			usage(1);
@@ -482,9 +479,14 @@ main(int argc, char * const *argv)
 	if (sock < 0)
 		exit(2);
 
-	if (argc > 0)
+	if (argc > 0) {
+		VSIG_Arm_int();
+		VSIG_Arm_term();
 		do_args(sock, argc, argv);
-	else if (isatty(0))
+		NEEDLESS(exit(0));
+	}
+
+	if (isatty(0))
 		interactive(sock);
 	else
 		pass(sock);


More information about the varnish-commit mailing list