From 0f650fc8075adb2ba36d3d48c71fa69f30489d01 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 26 Jan 2010 23:50:08 +0000 Subject: [PATCH] Auto-detect if Hudson is run in Solaris SMF and provide restart capability. (report) git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@26478 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/lifecycle/Lifecycle.java | 3 +++ ips/hudson.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/lifecycle/Lifecycle.java b/core/src/main/java/hudson/lifecycle/Lifecycle.java index 754685c670..54522e4d46 100644 --- a/core/src/main/java/hudson/lifecycle/Lifecycle.java +++ b/core/src/main/java/hudson/lifecycle/Lifecycle.java @@ -83,6 +83,9 @@ public abstract class Lifecycle implements ExtensionPoint { "Default Windows lifecycle does not support restart."); } }; + } else if (System.getenv("SMF_FMRI")!=null && System.getenv("SMF_RESTARTER")!=null) { + // when we are run by Solaris SMF, these environment variables are set. + instance = new SolarisSMFLifecycle(); } else { // if run on Unix, we can do restart try { diff --git a/ips/hudson.xml b/ips/hudson.xml index aa7fa74cc2..cdd8294ac3 100644 --- a/ips/hudson.xml +++ b/ips/hudson.xml @@ -45,7 +45,7 @@ THE SOFTWARE. - +