karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1539298 - /karaf/trunk/main/src/main/java/org/apache/karaf/main/Status.java
Date Wed, 06 Nov 2013 10:21:04 GMT
Author: jbonofre
Date: Wed Nov  6 10:21:04 2013
New Revision: 1539298

URL: http://svn.apache.org/r1539298
Log:
Improve status script with new exit code

Modified:
    karaf/trunk/main/src/main/java/org/apache/karaf/main/Status.java

Modified: karaf/trunk/main/src/main/java/org/apache/karaf/main/Status.java
URL: http://svn.apache.org/viewvc/karaf/trunk/main/src/main/java/org/apache/karaf/main/Status.java?rev=1539298&r1=1539297&r2=1539298&view=diff
==============================================================================
--- karaf/trunk/main/src/main/java/org/apache/karaf/main/Status.java (original)
+++ karaf/trunk/main/src/main/java/org/apache/karaf/main/Status.java Wed Nov  6 10:21:04 2013
@@ -37,7 +37,15 @@ public class Status {
     public static void main(String[] args) throws Exception {
         ConfigProperties config = new ConfigProperties();
         if (config.shutdownPort == 0 && config.portFile != null) {
-            config.shutdownPort = getPortFromShutdownPortFile(config.portFile);
+            try {
+                config.shutdownPort = getPortFromShutdownPortFile(config.portFile);
+            } catch (FileNotFoundException fnfe) {
+                System.err.println(config.portFile + " port file doesn't exist. The container
is not running.");
+                System.exit(3);
+            } catch (IOException ioe) {
+                System.err.println("Can't read " + config.portFile + " port file: " + ioe.getMessage());
+                System.exit(4);
+            }
         }
         if (config.shutdownPort > 0) {
             Socket s = null;



Mime
View raw message