From 5584a80dc11dddc7513d1ad6ffa4b9f53a9320d0 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 12 Feb 2009 00:59:42 +0000 Subject: [PATCH] Adding ZFS migration support, but not activated for now. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15248 71c3de6d-444a-0410-be80-ed276b4c234a --- core/pom.xml | 5 + .../java/hudson/lifecycle/ZFSInstaller.java | 307 ++++++++++++++++++ core/src/main/java/hudson/model/Hudson.java | 12 + .../java/hudson/util/jna/GNUCLibrary.java | 11 + .../MigrationCompleteNotice/message.jelly | 32 ++ .../MigrationFailedNotice/index.jelly | 31 ++ .../MigrationFailedNotice/message.jelly | 30 ++ .../lifecycle/ZFSInstaller/confirm.jelly | 53 +++ .../lifecycle/ZFSInstaller/confirm.properties | 27 ++ .../lifecycle/ZFSInstaller/message.jelly | 35 ++ .../lifecycle/ZFSInstaller/message.properties | 24 ++ 11 files changed, 567 insertions(+) create mode 100644 core/src/main/java/hudson/lifecycle/ZFSInstaller.java create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationCompleteNotice/message.jelly create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/index.jelly create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/message.jelly create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.jelly create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.properties create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.jelly create mode 100644 core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.properties diff --git a/core/pom.xml b/core/pom.xml index 3590099ad8..a04017a393 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -632,6 +632,11 @@ THE SOFTWARE. libpam4j 1.1 + + org.jvnet.libzfs + libzfs + 0.2 + + + +
+
+ ${%Data was successfully migrated to ZFS.} + + +
+
\ No newline at end of file diff --git a/core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/index.jelly b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/index.jelly new file mode 100644 index 0000000000..9696e17117 --- /dev/null +++ b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/index.jelly @@ -0,0 +1,31 @@ + + + + +

${%ZFS Migration Problem}

+
+
+
+
diff --git a/core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/message.jelly b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/message.jelly new file mode 100644 index 0000000000..441dce664c --- /dev/null +++ b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/MigrationFailedNotice/message.jelly @@ -0,0 +1,30 @@ + + + +
+ ${%ZFS migration failed.} + See the log for more details. +
+
\ No newline at end of file diff --git a/core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.jelly b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.jelly new file mode 100644 index 0000000000..392515d79b --- /dev/null +++ b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.jelly @@ -0,0 +1,53 @@ + + + + + + + +

${%ZFS file system creation}

+
+ ${%blurb} + + +
+ ${%You'll need the root password of the system to do this.} +
+
+
    +
  1. ${%Restart itself so that the migration can be done without worrying about concurrent data modifications}
  2. +
  3. ${%create(it.prospectiveZfsFileSystemName)}
  4. +
  5. ${%rename(app.rootDir)}
  6. +
  7. ${%mount(app.rootDir)}
  8. +
  9. ${%delete(app.rootDir)}
  10. +
+ +
+ + +
+
+
+
\ No newline at end of file diff --git a/core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.properties b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.properties new file mode 100644 index 0000000000..0c1dece2d5 --- /dev/null +++ b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/confirm.properties @@ -0,0 +1,27 @@ +# The MIT License +# +# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +blurb=Hudson will perform the following steps to migrate your existing data to a ZFS file system. +create=Create a new ZFS file system {0} and copy all the data into it +rename=Rename {0} to {0}.backup +mount=Mount a new ZFS file system at {0} +delete=Delete {0}.backup \ No newline at end of file diff --git a/core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.jelly b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.jelly new file mode 100644 index 0000000000..489418dad1 --- /dev/null +++ b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.jelly @@ -0,0 +1,35 @@ + + + +
+
+

${%blurb}

+
+ + +
+
+
+
\ No newline at end of file diff --git a/core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.properties b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.properties new file mode 100644 index 0000000000..c827d7b8e3 --- /dev/null +++ b/core/src/main/resources/hudson/lifecycle/ZFSInstaller/message.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +blurb=You are running on Solaris. Would you like Hudson to create a ZFS file system for you \ + so that you can get the most out of Solaris? \ No newline at end of file -- GitLab