Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-1563

Support clean-all & clean-cache directly in karaf main jar

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None

      Description

      Currently the clean param is executed by the karaf startup scripts. Therefore it's e.g. not possible to clear the cache if you're using karaf-wrapper. Therefore this code should rather be moved directly in the karaf main jar instead of the script. In addition there are situations where you don't want to delete the data folder, but rather only the cache folder in KARAF_DATA. Therefore it's a good idea to support a clean-all option (clean is an alias for it) and clean-cache.

      1. KARAF-1563.patch.txt
        7 kB
        Andreas Pieber
      2. KARAF-1563.patch.txt
        7 kB
        Andreas Pieber

        Issue Links

          Activity

          Hide
          pieber Andreas Pieber added a comment -

          I think we might want to consider moving this also to the code as described in KARAF-1563 to make it work independently of the situation a clean is done

          Show
          pieber Andreas Pieber added a comment - I think we might want to consider moving this also to the code as described in KARAF-1563 to make it work independently of the situation a clean is done
          Hide
          pieber Andreas Pieber added a comment -

          BTW, I'll give it a shot if we can fix KARAF-1805 together with KARAF-1563

          Show
          pieber Andreas Pieber added a comment - BTW, I'll give it a shot if we can fix KARAF-1805 together with KARAF-1563
          Hide
          pieber Andreas Pieber added a comment -

          Idea how this feature could be implemented

          Show
          pieber Andreas Pieber added a comment - Idea how this feature could be implemented
          Hide
          pieber Andreas Pieber added a comment -

          OK, redesigned some parts; you can either now clean your cache or the entire data directory by creating a file in data or by setting a system property. This should handle most usecases (even those with limited rights

          Show
          pieber Andreas Pieber added a comment - OK, redesigned some parts; you can either now clean your cache or the entire data directory by creating a file in data or by setting a system property. This should handle most usecases (even those with limited rights
          Hide
          pieber Andreas Pieber added a comment - - edited

          that way you can force a data dir clean by something like the following from anywhere in your code:

          new File(System.getProperty("karaf.data"), "clean_all").setLastModified(new Date().getTime());

          Show
          pieber Andreas Pieber added a comment - - edited that way you can force a data dir clean by something like the following from anywhere in your code: new File(System.getProperty("karaf.data"), "clean_all").setLastModified(new Date().getTime());
          Hide
          jgoodyear Jamie goodyear added a comment -

          The patch looks good to me, I'd like to see one extra feature added:
          As with the shutdown command the restart should as for confirmation (yes/no) or process using a -f (force) flag to do the restart.

          Show
          jgoodyear Jamie goodyear added a comment - The patch looks good to me, I'd like to see one extra feature added: As with the shutdown command the restart should as for confirmation (yes/no) or process using a -f (force) flag to do the restart.
          Hide
          jgoodyear Jamie goodyear added a comment -

          Actually i would really want a confirm request here:

          Scenario:
          Admin types restart thinking 'refresh' - a very different system state will result from these commands.

          Show
          jgoodyear Jamie goodyear added a comment - Actually i would really want a confirm request here: Scenario: Admin types restart thinking 'refresh' - a very different system state will result from these commands.
          Hide
          pieber Andreas Pieber added a comment -

          applied to master; waiting for 2.4.x branch to apply there too and resolve issue

          Committing to https://svn.apache.org/repos/asf/karaf/trunk ...
                  M       assemblies/features/framework/src/main/resources/resources/etc/system.properties
                  M       instance/core/src/main/resources/org/apache/karaf/instance/resources/etc/system.properties
                  M       main/src/main/java/org/apache/karaf/main/ConfigProperties.java
                  M       system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
                  M       system/core/src/main/java/org/apache/karaf/system/SystemService.java
                  M       system/core/src/main/java/org/apache/karaf/system/internal/SystemServiceImpl.java
                  M       system/core/src/main/java/org/apache/karaf/system/management/SystemMBean.java
                  M       system/core/src/main/java/org/apache/karaf/system/management/internal/System.java
          Committed r1433832
          
          Show
          pieber Andreas Pieber added a comment - applied to master; waiting for 2.4.x branch to apply there too and resolve issue Committing to https: //svn.apache.org/repos/asf/karaf/trunk ... M assemblies/features/framework/src/main/resources/resources/etc/system.properties M instance/core/src/main/resources/org/apache/karaf/instance/resources/etc/system.properties M main/src/main/java/org/apache/karaf/main/ConfigProperties.java M system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java M system/core/src/main/java/org/apache/karaf/system/SystemService.java M system/core/src/main/java/org/apache/karaf/system/internal/SystemServiceImpl.java M system/core/src/main/java/org/apache/karaf/system/management/SystemMBean.java M system/core/src/main/java/org/apache/karaf/system/management/internal/ System .java Committed r1433832
          Hide
          pieber Andreas Pieber added a comment -

          Jamie goodyear good point; but maybe a little bit outside this issue; have you already created a new issue for this or should I?

          Show
          pieber Andreas Pieber added a comment - Jamie goodyear good point; but maybe a little bit outside this issue; have you already created a new issue for this or should I?
          Hide
          achim_nierbeck Achim Nierbeck added a comment -

          Hey guys this one is strange,
          according to the comments it should be fixed with 3.0.0 but fix-version is 3.1.0.
          To my understanding we should have the 2.4.x branch ready already so is it already applied to that branch?

          Show
          achim_nierbeck Achim Nierbeck added a comment - Hey guys this one is strange, according to the comments it should be fixed with 3.0.0 but fix-version is 3.1.0. To my understanding we should have the 2.4.x branch ready already so is it already applied to that branch?
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          Regarding the Jira history, Christian moved this issue to 3.1.0 (26/Apr/13). It should be 3.0.0 (as it's fixed on this release). The karaf-2.x branch should be updated as well.

          Show
          jbonofre Jean-Baptiste Onofré added a comment - Regarding the Jira history, Christian moved this issue to 3.1.0 (26/Apr/13). It should be 3.0.0 (as it's fixed on this release). The karaf-2.x branch should be updated as well.
          Hide
          pieber Andreas Pieber added a comment -

          This one had already been pushed to 3.x; I'm currently working on the backport to 2.4 and I'm quite optimistic to push the change by today.

          Show
          pieber Andreas Pieber added a comment - This one had already been pushed to 3.x; I'm currently working on the backport to 2.4 and I'm quite optimistic to push the change by today.
          Hide
          pieber Andreas Pieber added a comment -

          applied to 2.x

          Committing to https://svn.apache.org/repos/asf/karaf/branches/karaf-2.x ...
                  M       admin/core/src/main/resources/org/apache/karaf/admin/etc/system.properties
                  M       assemblies/apache-karaf/src/main/distribution/text/etc/system.properties
                  M       main/src/main/java/org/apache/karaf/main/Main.java
                  M       shell/dev/src/main/java/org/apache/karaf/shell/dev/Restart.java
          Committed r1485070
          

          I'll add a section to the userguid to the master & 2.x during the day and resolve this issue afterwards.

          Show
          pieber Andreas Pieber added a comment - applied to 2.x Committing to https: //svn.apache.org/repos/asf/karaf/branches/karaf-2.x ... M admin/core/src/main/resources/org/apache/karaf/admin/etc/system.properties M assemblies/apache-karaf/src/main/distribution/text/etc/system.properties M main/src/main/java/org/apache/karaf/main/Main.java M shell/dev/src/main/java/org/apache/karaf/shell/dev/Restart.java Committed r1485070 I'll add a section to the userguid to the master & 2.x during the day and resolve this issue afterwards.
          Hide
          pieber Andreas Pieber added a comment -

          Added documentation for 2.x version

          Committing to https://svn.apache.org/repos/asf/karaf/branches/karaf-2.x ...
                  M       manual/src/main/webapp/users-guide/start-stop.conf
          Committed r1485109
          

          I'll do the master next

          Show
          pieber Andreas Pieber added a comment - Added documentation for 2.x version Committing to https: //svn.apache.org/repos/asf/karaf/branches/karaf-2.x ... M manual/src/main/webapp/users-guide/start-stop.conf Committed r1485109 I'll do the master next
          Hide
          pieber Andreas Pieber added a comment -

          Committing to https://svn.apache.org/repos/asf/karaf/trunk ...
          M manual/src/main/webapp/users-guide/start-stop.conf
          Committed r1485110

          Show
          pieber Andreas Pieber added a comment - Committing to https://svn.apache.org/repos/asf/karaf/trunk ... M manual/src/main/webapp/users-guide/start-stop.conf Committed r1485110

            People

            • Assignee:
              pieber Andreas Pieber
              Reporter:
              pieber Andreas Pieber
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development