[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-cvs
Subject:    /bzr/squid3/trunk/ r9526: Author: Mark Nottingham <mnot@pobox.com>
From:       Amos Jeffries <squid3 () treenet ! co ! nz>
Date:       2009-02-23 9:41:36
Message-ID: 20090223094506.96066.qmail () squid-cache ! org
[Download RAW message or body]

--===============0526154067==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------
revno: 9526
committer: Amos Jeffries <squid3@treenet.co.nz>
branch nick: trunk
timestamp: Mon 2009-02-23 22:41:36 +1300
message:
  Author: Mark Nottingham <mnot@pobox.com>
  Bug 2599: Idempotent start
  
  As discussed on squid-dev, Squid shouldn't return a shell error when:
    - starting squid, if it's already running
    - stopping squid, if it isn't running
  This is to make writing scripts that control squid easier.
  
  Note that it should still notify the user, and should not affect other
  operations (e.g., kill, rotate, parse).
modified:
  src/main.cc

--===============0526154067==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; name="r9526.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

=== modified file 'src/main.cc'
--- a/src/main.cc	2009-02-16 21:24:39 +0000
+++ b/src/main.cc	2009-02-23 09:41:36 +0000
@@ -1240,7 +1240,7 @@
     setUmask(Config.umask);
     if (-1 == opt_send_signal)
         if (checkRunningPid())
-            exit(1);
+            exit(0);
 
 #if TEST_ACCESS
 
@@ -1396,8 +1396,13 @@
             exit(1);
         }
     } else {
-        fprintf(stderr, "%s: ERROR: No running copy\n", APP_SHORTNAME);
-        exit(1);
+        if (opt_send_signal != SIGTERM) {
+            fprintf(stderr, "%s: ERROR: No running copy\n", appname);
+            exit(1);
+        } else {
+            fprintf(stderr, "%s: No running copy\n", appname);
+            exit(0);
+        }
     }
 
     /* signal successfully sent */


--===============0526154067==--
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic