提交 6ed48594 编写于 作者: K kohsuke

share the file system

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15252 71c3de6d-444a-0410-be80-ed276b4c234a
上级 04454479
...@@ -39,6 +39,7 @@ import org.jvnet.solaris.libzfs.LibZFS; ...@@ -39,6 +39,7 @@ import org.jvnet.solaris.libzfs.LibZFS;
import org.jvnet.solaris.libzfs.ZFSFileSystem; import org.jvnet.solaris.libzfs.ZFSFileSystem;
import org.jvnet.solaris.libzfs.ZFSPool; import org.jvnet.solaris.libzfs.ZFSPool;
import org.jvnet.solaris.libzfs.ZFSType; import org.jvnet.solaris.libzfs.ZFSType;
import org.jvnet.solaris.libzfs.ZFSException;
import org.jvnet.solaris.mount.MountFlags; import org.jvnet.solaris.mount.MountFlags;
import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.StaplerResponse;
...@@ -177,9 +178,8 @@ public class ZFSInstaller extends AdministrativeMonitor { ...@@ -177,9 +178,8 @@ public class ZFSInstaller extends AdministrativeMonitor {
monitors.add(new MigrationCompleteNotice()); monitors.add(new MigrationCompleteNotice());
return; return;
} }
} catch (IOException e) { } catch (Exception e) {
e.printStackTrace(listener.error("Migration failed")); // if we let any exception from here, it will prevent Hudson from starting.
} catch (InterruptedException e) {
e.printStackTrace(listener.error("Migration failed")); e.printStackTrace(listener.error("Migration failed"));
} }
// migration failed // migration failed
...@@ -221,6 +221,7 @@ public class ZFSInstaller extends AdministrativeMonitor { ...@@ -221,6 +221,7 @@ public class ZFSInstaller extends AdministrativeMonitor {
out.println("Creating "+name); out.println("Creating "+name);
ZFSFileSystem hudson = (ZFSFileSystem)zfs.create(name, ZFSType.FILESYSTEM); ZFSFileSystem hudson = (ZFSFileSystem)zfs.create(name, ZFSType.FILESYSTEM);
hudson.setMountPoint(tmpDir); hudson.setMountPoint(tmpDir);
hudson.setProperty("hudson:managed-by","hudson"); // mark this file system as "managed by Hudson"
hudson.mount(); hudson.mount();
// copy all the files // copy all the files
...@@ -250,6 +251,11 @@ public class ZFSInstaller extends AdministrativeMonitor { ...@@ -250,6 +251,11 @@ public class ZFSInstaller extends AdministrativeMonitor {
hudson.setMountPoint(home); hudson.setMountPoint(home);
hudson.mount(); hudson.mount();
out.println("Sharing "+name);
hudson.setProperty("sharesmb","on");
hudson.setProperty("sharenfs","on");
hudson.share();
// delete back up // delete back up
out.println("Deleting "+backup); out.println("Deleting "+backup);
if(system(new File("/"),listener,"/usr/bin/rm","-rf",backup.getAbsolutePath())!=0) { if(system(new File("/"),listener,"/usr/bin/rm","-rf",backup.getAbsolutePath())!=0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册