summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-02-15 15:01:42 -0600
committerEndi Sukma Dewata <edewata@redhat.com>2012-02-28 17:26:11 -0600
commit3a2cd2158ff31667432867181618d845267353a7 (patch)
tree3cd6b03ecca19d96c08ee30173622668322edb16
parented31fc445fc6d4769b7bd119770ae1da9b15d2bf (diff)
downloadpki-3a2cd2158ff31667432867181618d845267353a7.tar.gz
pki-3a2cd2158ff31667432867181618d845267353a7.tar.xz
pki-3a2cd2158ff31667432867181618d845267353a7.zip
Removed OS subsystem.
The OS subsystem was previously used to get the PID and to handle shutdown signals using the OSUtil. It has been removed because the functionalities can be obtained without using native code. The PID will now be read from an external PID file created by the wrapper script. The shutdown signals will now be handled by shutdown hook. Ticket #90
-rw-r--r--pki/base/ca/shared/conf/CS.cfg.in1
-rw-r--r--pki/base/common/src/CMakeLists.txt1
-rw-r--r--pki/base/common/src/com/netscape/certsrv/apps/CMS.java4
-rw-r--r--pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java2
-rw-r--r--pki/base/common/src/com/netscape/cms/logging/LogFile.java9
-rw-r--r--pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java56
-rw-r--r--pki/base/common/src/com/netscape/cmscore/apps/Upgrade.java4
-rw-r--r--pki/base/common/src/com/netscape/cmscore/util/OsSubsystem.java440
-rw-r--r--pki/base/common/test/com/netscape/certsrv/app/CMSEngineDefaultStub.java2
-rw-r--r--pki/base/kra/shared/conf/CS.cfg.in1
-rw-r--r--pki/base/ocsp/shared/conf/CS.cfg.in1
-rw-r--r--pki/base/ra/doc/CS.cfg.in1
-rwxr-xr-xpki/base/setup/pkicreate8
-rw-r--r--pki/base/tks/shared/conf/CS.cfg.in1
-rw-r--r--pki/base/tps/doc/CS.cfg.in1
15 files changed, 66 insertions, 466 deletions
diff --git a/pki/base/ca/shared/conf/CS.cfg.in b/pki/base/ca/shared/conf/CS.cfg.in
index d5d66f9bf..13278ae72 100644
--- a/pki/base/ca/shared/conf/CS.cfg.in
+++ b/pki/base/ca/shared/conf/CS.cfg.in
@@ -40,6 +40,7 @@ securitydomain.checkinterval=300000
instanceRoot=[PKI_INSTANCE_PATH]
machineName=[PKI_MACHINE_NAME]
instanceId=[PKI_INSTANCE_ID]
+pidDir=[PKI_PIDDIR]
service.machineName=[PKI_MACHINE_NAME]
service.instanceDir=[PKI_INSTANCE_ROOT]
service.securePort=[PKI_AGENT_SECURE_PORT]
diff --git a/pki/base/common/src/CMakeLists.txt b/pki/base/common/src/CMakeLists.txt
index 1deeb470a..3f599ee13 100644
--- a/pki/base/common/src/CMakeLists.txt
+++ b/pki/base/common/src/CMakeLists.txt
@@ -883,7 +883,6 @@ set(pki-cmscore_java_SRCS
com/netscape/cmscore/util/ExceptionFormatter.java
com/netscape/cmscore/util/StatsSubsystem.java
com/netscape/cmscore/util/FileDialogFilter.java
- com/netscape/cmscore/util/OsSubsystem.java
com/netscape/cmscore/util/Debug.java
com/netscape/cmscore/util/UtilResources.java
com/netscape/cmscore/policy/JavaScriptRequestProxy.java
diff --git a/pki/base/common/src/com/netscape/certsrv/apps/CMS.java b/pki/base/common/src/com/netscape/certsrv/apps/CMS.java
index 5b8aa2c78..3a36c71bc 100644
--- a/pki/base/common/src/com/netscape/certsrv/apps/CMS.java
+++ b/pki/base/common/src/com/netscape/certsrv/apps/CMS.java
@@ -347,8 +347,8 @@ public final class CMS {
*
* @return process id of the server
*/
- public static int getpid() {
- return _engine.getpid();
+ public static int getPID() {
+ return _engine.getPID();
}
/**
diff --git a/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java b/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java
index d299b5814..ba9731867 100644
--- a/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java
+++ b/pki/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java
@@ -111,7 +111,7 @@ public interface ICMSEngine extends ISubsystem {
*
* @return process id of the server
*/
- public int getpid();
+ public int getPID();
public void reinit(String id) throws EBaseException;
diff --git a/pki/base/common/src/com/netscape/cms/logging/LogFile.java b/pki/base/common/src/com/netscape/cms/logging/LogFile.java
index 15ffafec5..0a5f18579 100644
--- a/pki/base/common/src/com/netscape/cms/logging/LogFile.java
+++ b/pki/base/common/src/com/netscape/cms/logging/LogFile.java
@@ -184,11 +184,6 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo {
private Thread mFlushThread = null;
/**
- * The current pid for the log entries
- */
- protected int mPid = CMS.getpid();
-
- /**
* The selected log event types
*/
protected String mSelectedEventsList = null;
@@ -1105,12 +1100,12 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo {
// This should follow the Common Log Format which still needs
// some work.
if (ev.getMultiline() == ILogger.L_MULTILINE) {
- entry = mPid + "." + Thread.currentThread().getName() + " - ["
+ entry = CMS.getPID() + "." + Thread.currentThread().getName() + " - ["
+ mLogDateFormat.format(mDate) + "] [" +
Integer.toString(ev.getSource()) + "] [" + Integer.toString(ev.getLevel())
+ "] " + prepareMultiline(ev.toString());
} else {
- entry = mPid + "." + Thread.currentThread().getName() + " - ["
+ entry = CMS.getPID() + "." + Thread.currentThread().getName() + " - ["
+ mLogDateFormat.format(mDate) + "] [" +
Integer.toString(ev.getSource()) + "] [" + Integer.toString(ev.getLevel())
+ "] " + ev.toString();
diff --git a/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java b/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
index ba8462727..5fdcaece0 100644
--- a/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
+++ b/pki/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
@@ -17,8 +17,10 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.apps;
+import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
@@ -167,7 +169,6 @@ import com.netscape.cmscore.security.PWsdrCache;
import com.netscape.cmscore.time.SimpleTimeSource;
import com.netscape.cmscore.usrgrp.UGSubsystem;
import com.netscape.cmscore.util.Debug;
-import com.netscape.cmscore.util.OsSubsystem;
import com.netscape.cmsutil.net.ISocketFactory;
import com.netscape.cmsutil.password.IPasswordStore;
import com.netscape.cmsutil.util.Utils;
@@ -182,7 +183,9 @@ public class CMSEngine implements ICMSEngine {
public static final SubsystemRegistry mSSReg = SubsystemRegistry.getInstance();
- public static String instanceDir; /* path to instance <server-root>/cert-<instance-name> */
+ public String instanceDir; /* path to instance <server-root>/cert-<instance-name> */
+ private String instanceId;
+ private int pid;
private IConfigStore mConfig = null;
private ISubsystem mOwner = null;
@@ -204,8 +207,6 @@ public class CMSEngine implements ICMSEngine {
new SubsystemInfo(LogSubsystem.ID,
LogSubsystem.getInstance()),
new SubsystemInfo(
- OsSubsystem.ID, OsSubsystem.getInstance()),
- new SubsystemInfo(
JssSubsystem.ID, JssSubsystem.getInstance()),
new SubsystemInfo(
DBSubsystem.ID, DBSubsystem.getInstance()),
@@ -256,6 +257,22 @@ public class CMSEngine implements ICMSEngine {
* private constructor.
*/
public CMSEngine() {
+
+ // Shutdown on SIGINT, SIGTERM, or SIGHUP.
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ /*LogDoc
+ *
+ * @phase watchdog check
+ */
+ getLogger().log(ILogger.EV_SYSTEM,
+ ILogger.S_OTHER,
+ ILogger.LL_INFO,
+ "OS: Received shutdown signal");
+
+ shutdown();
+ };
+ });
}
/**
@@ -359,6 +376,7 @@ public class CMSEngine implements ICMSEngine {
}
instanceDir = config.getString("instanceRoot");
+ instanceId = config.getString("instanceId");
loadDynSubsystems();
@@ -958,7 +976,6 @@ public class CMSEngine implements ICMSEngine {
* @exception EBaseException if any subsystem fails to startup.
*/
public void startup() throws EBaseException {
- //OsSubsystem.nativeExit(0);
startupSubsystems(mStaticSubsystems);
if (mDynSubsystems != null)
startupSubsystems(mDynSubsystems);
@@ -1539,7 +1556,7 @@ public class CMSEngine implements ICMSEngine {
return (File.separator.equals("\\"));
}
- private static void shutdownHttpServer() {
+ private void shutdownHttpServer() {
try {
String cmds[] = null;
@@ -1691,8 +1708,31 @@ public class CMSEngine implements ICMSEngine {
return new PWCBsdr();
}
- public int getpid() {
- return OsSubsystem.getpid();
+ public int getPID() {
+ if (pid != 0) return pid;
+
+ BufferedReader bf = null;
+ try {
+ // PID file is be created by wrapper script (e.g. /usr/sbin/tomcat6)
+ String dir = mConfig.getString("pidDir");
+ String name = dir+File.separator+instanceId+".pid";
+
+ if (dir == null) return pid;
+ File file = new File(name);
+ if (!file.exists()) return pid;
+
+ bf = new BufferedReader(new FileReader(file));
+ String value = bf.readLine();
+ pid = Integer.parseInt(value);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ } finally {
+ if (bf != null) try { bf.close(); } catch (Exception e) { e.printStackTrace(); }
+ }
+
+ return pid;
}
public Date getCurrentDate() {
diff --git a/pki/base/common/src/com/netscape/cmscore/apps/Upgrade.java b/pki/base/common/src/com/netscape/cmscore/apps/Upgrade.java
index 326e9b5e6..cd5b2991f 100644
--- a/pki/base/common/src/com/netscape/cmscore/apps/Upgrade.java
+++ b/pki/base/common/src/com/netscape/cmscore/apps/Upgrade.java
@@ -21,7 +21,7 @@ import java.io.File;
import com.netscape.certsrv.base.EBaseException;
import com.netscape.certsrv.base.IConfigStore;
-import com.netscape.cmscore.util.OsSubsystem;
+import com.netscape.cmsutil.util.Utils;
public final class Upgrade {
public static void perform422to45(IConfigStore c)
@@ -124,7 +124,7 @@ public final class Upgrade {
c.putString("log.instance.System.type",
"system");
- if (!OsSubsystem.isUnix()) {
+ if (Utils.isNT()) {
c.putString("log.impl.NTEventLog.class",
"com.netscape.certsrv.logging.NTEventLog");
diff --git a/pki/base/common/src/com/netscape/cmscore/util/OsSubsystem.java b/pki/base/common/src/com/netscape/cmscore/util/OsSubsystem.java
deleted file mode 100644
index 6e5162d9a..000000000
--- a/pki/base/common/src/com/netscape/cmscore/util/OsSubsystem.java
+++ /dev/null
@@ -1,440 +0,0 @@
-// --- BEGIN COPYRIGHT BLOCK ---
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// (C) 2007 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.cmscore.util;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import com.netscape.certsrv.apps.CMS;
-import com.netscape.certsrv.base.EBaseException;
-import com.netscape.certsrv.base.IConfigStore;
-import com.netscape.certsrv.base.ISubsystem;
-import com.netscape.certsrv.logging.ILogger;
-import com.netscape.cmscore.base.SubsystemRegistry;
-import com.netscape.osutil.LibC;
-import com.netscape.osutil.OSUtil;
-import com.netscape.osutil.Signal;
-import com.netscape.osutil.SignalListener;
-import com.netscape.osutil.UserID;
-
-/**
- * This object contains the OS independent interfaces. It's currently
- * used for Unix signal and user handling, but could eventually be extended
- * for NT interfaces.
- * <P>
- *
- * @author mikep
- * @version $Revision$, $Date$
- */
-public final class OsSubsystem implements ISubsystem {
-
- public static final String ID = "os";
- protected IConfigStore mConfig;
- protected String mInstanceDir;
- protected ISubsystem mOwner;
- protected ILogger mLogger = null;
- protected static SignalThread mSignalThread = null;
-
- private static final String PROP_OS = "os";
- private static final String PROP_USERID = "userid";
-
- // singleton enforcement
-
- private static OsSubsystem mInstance = new OsSubsystem();
-
- public static OsSubsystem getInstance() {
- return mInstance;
- }
-
- // end singleton enforcement.
-
- /**
- * Constructor for an OS subsystem
- */
- private OsSubsystem() {
- }
-
- /**
- * Retrieves subsystem name.
- */
- public String getId() {
- return ID;
- }
-
- public void setId(String id) throws EBaseException {
- throw new EBaseException(CMS.getUserMessage("CMS_BASE_INVALID_OPERATION"));
- }
-
- /**
- * Initializes this subsystem with the given configuration
- * store.
- * <P>
- *
- * @param owner owner of this subsystem
- * @param config configuration store
- * @exception EBaseException failed to initialize
- */
- public void init(ISubsystem owner, IConfigStore config)
- throws EBaseException {
-
- mOwner = owner;
- mConfig = config;
- mLogger = CMS.getLogger();
-
- mInstanceDir = CMS.getConfigStore().getString("instanceRoot");
-
- // We currently only deal with Unix and NT
- if (isUnix()) {
- //initUnix();
- } else {
- initNT();
- }
- try {
- //System.out.println(" The dir I'm seeing is " + mInstanceDir);
- String pidName = mInstanceDir + File.separator + "config" + File.separator + "cert-pid";
- BufferedWriter pidOut = new BufferedWriter(new FileWriter(pidName));
- int pid = OsSubsystem.getpid();
-
- pidOut.write(Integer.toString(pid));
- pidOut.close();
- OSUtil.getFileWriteLock(pidName);
- } catch (Exception e) {
- //XX to stderr XXXXXX
- //e.printStackTrace();
- }
- }
-
- /**
- * Starts up OS
- */
- public void startup() throws EBaseException {
- if (isUnix()) {
- String pf = mConfig.getString("pidFile", null);
-
- if (pf == null) {
- return; // development environment does not rely on this
- }
- // dont ever call detach in Java environment,
- // it does a fork()
- // LibC.detach();
-
- // need to do pid here, pid will be changed after detach
- int pid = LibC.getpid();
- String pidStr = Integer.toString(pid);
-
- try {
- FileOutputStream fos = new FileOutputStream(pf);
-
- fos.write(pidStr.getBytes());
- fos.close();
- } catch (IOException e) {
-
- /*LogDoc
- *
- * @phase start OS subsystem
- * @message OS: <exception thrown>
- */
- mLogger.log(ILogger.EV_SYSTEM, ILogger.S_OTHER,
- ILogger.LL_FAILURE, "OS: " + e.toString());
- }
- }
- }
-
- /**
- * Returns the process ID of the Certificate Server process. Works
- * on Unix and NT.
- */
- public static int getpid() {
- if (isUnix()) {
- return LibC.getpid();
- } else {
- return OSUtil.getNTpid();
- }
- }
-
- /**
- * Used to change the process user id usually called after the appropriate
- * network ports have been opened.
- */
- public void setUserId() throws EBaseException {
- if (!isUnix())
- return;
-
- String userid;
-
- userid = mConfig.getString(PROP_USERID, null);
- String id = String.valueOf(UserID.get());
-
- // Change the userid to the prefered Unix user
- if (userid == null) {
-
- /*LogDoc
- *
- * @phase set user id
- * @arg0 default user id
- */
- mLogger.log(ILogger.EV_SYSTEM, ILogger.S_OTHER,
- ILogger.LL_FAILURE,
- "OS: No user id in config file. Running as {0}", id);
- } else {
- Object[] params = { userid, id };
-
- try {
- UserID.set(userid);
- } catch (IllegalArgumentException e) {
-
- /*LogDoc
- *
- * @phase set user id
- * @arg0 supplied user id in config
- * @arg1 default user id
- */
- mLogger.log(ILogger.EV_SYSTEM, ILogger.S_OTHER,
- ILogger.LL_FAILURE,
- "OS: No such user as {0}. Running as {1}", params);
- } catch (SecurityException e) {
-
- /*LogDoc
- *
- * @phase set user id
- * @arg0 supplied user id in config
- * @arg1 default user id
- */
- mLogger.log(ILogger.EV_SYSTEM, ILogger.S_OTHER,
- ILogger.LL_FAILURE,
- "OS: Can't change process uid to {0}. Running as {1}",
- params);
- }
- }
- }
-
- private void initNT() {
- }
-
- /**
- * Stops the watchdog. You need to call this if you want the
- * server to really shutdown, otherwise the watchdog will just
- * restart us.
- * <P>
- */
- public static void stop() {
- if (isUnix()) {
- shutdownUnix();
- Signal.send(LibC.getppid(), Signal.SIGTERM);
- } else {
-
- /*LogDoc
- *
- * @phase stop watchdog
- */
- CMS.getLogger().log(ILogger.EV_SYSTEM, ILogger.S_OTHER,
- ILogger.LL_INFO,
- "OS: stop the NT watchdog!");
- }
- }
-
- /**
- * Stops this system.
- * <P>
- */
- public void shutdown() {
- if (isUnix()) {
- shutdownUnix();
- } else {
- shutdownNT();
- }
- }
-
- /**
- * Shutdown the unix system handlers
- * <P>
- */
- private static void shutdownUnix() {
-
- // Don't accidentally stop this thread
- //if (Thread.currentThread() != mSignalThread && mSignalThread != null) {
- // mSignalThread.stop();
- // mSignalThread = null;
- //}
-
- /* Don't release this signals to protect the process
- Signal.release(Signal.SIGHUP);
- Signal.release(Signal.SIGTERM);
- Signal.release(Signal.SIGINT);
- */
- }
-
- /**
- * Shutdown the NT system handlers
- * <P>
- */
- private void shutdownNT() {
- }
-
- /**
- * Restart the server
- * <P>
- */
- public void restart() {
-
- /**
- * if (isUnix()) {
- * restartUnix();
- * } else {
- * restartNT();
- * }
- **/
- }
-
- /**
- * Returns the root configuration storage of this system.
- * <P>
- *
- * @return configuration store of this subsystem
- */
- public IConfigStore getConfigStore() {
- return mConfig;
- }
-
- /**
- * A universal routine to decide if we are Unix or something else.
- * This is mostly used for signal handling and uids.
- *
- * <P>
- *
- * @return true if these OS the JavaVM is running on is some Unix varient
- */
- public static boolean isUnix() {
- // XXX What about MacOS?
- return (File.separatorChar == '/');
- }
-
- /**
- * Unix signal thread. Sleep for a second and then check on the
- * signals we're interested in. If one is set, do the right stuff
- */
- final class SignalThread extends Thread {
-
- /**
- * Signal thread constructor
- */
- public SignalThread() {
- super();
- super.setName("OsSignal-" + (Thread.activeCount() + 1));
- }
-
- /**
- * Check for signal changes every second
- */
- public void run() {
- while (true) {
- // Sleep for the interval and then check for caught signals
- // synchronized (Thread.this) {
- synchronized (this) {
- try {
- // Thread.this.wait(1000);
- this.wait(1000);
- } catch (InterruptedException e) {
- // Not very interesting...
- }
- }
-
- // wants us to exit?
- if (Signal.caught(Signal.SIGINT) > 0 ||
- Signal.caught(Signal.SIGTERM) > 0) {
-
- /*LogDoc
- *
- * @phase watchdog check
- */
- mLogger.log(ILogger.EV_SYSTEM,
- ILogger.S_OTHER,
- ILogger.LL_INFO,
- "OS: Received shutdown signal");
- SubsystemRegistry.getInstance().get("MAIN").shutdown();
- return;
- }
-
- // Tell to restart us
- if (Signal.caught(Signal.SIGHUP) > 0) {
-
- /*LogDoc
- *
- * @phase watchdog check
- */
- mLogger.log(ILogger.EV_SYSTEM,
- ILogger.S_OTHER,
- ILogger.LL_INFO,
- "OS: Received restart signal");
- restart();
- return;
- }
-
- }
- }
-
- }
-}
-
-class SIGTERMListener extends SignalListener {
- private OsSubsystem mOS;
-
- public SIGTERMListener(OsSubsystem os) {
- mOS = os;
- }
-
- public void process() {
- System.out.println("SIGTERMListener process");
- // XXX - temp, should call shutdown
- System.exit(0);
- //PKIServer.getPKIServer().shutdown();
- }
-}
-
-class SIGINTListener extends SignalListener {
- private OsSubsystem mOS;
-
- public SIGINTListener(OsSubsystem os) {
- mOS = os;
- }
-
- public void process() {
- System.out.println("SIGINTListener process");
- // XXX - temp, should call shutdown
- System.exit(0);
- //PKIServer.getPKIServer().shutdown();
- }
-}
-
-class SIGHUPListener extends SignalListener {
- private OsSubsystem mOS;
-
- public SIGHUPListener(OsSubsystem os) {
- mOS = os;
- }
-
- public void process() {
- System.out.println("SIGHUPListener process");
- // XXX - temp, should call shutdown
- // System.exit(0);
- //PKIServer.getPKIServer().shutdown();
- }
-}
diff --git a/pki/base/common/test/com/netscape/certsrv/app/CMSEngineDefaultStub.java b/pki/base/common/test/com/netscape/certsrv/app/CMSEngineDefaultStub.java
index f27cabb2c..cddd1205a 100644
--- a/pki/base/common/test/com/netscape/certsrv/app/CMSEngineDefaultStub.java
+++ b/pki/base/common/test/com/netscape/certsrv/app/CMSEngineDefaultStub.java
@@ -88,7 +88,7 @@ public class CMSEngineDefaultStub implements ICMSEngine {
return null;
}
- public int getpid() {
+ public int getPID() {
return 0;
}
diff --git a/pki/base/kra/shared/conf/CS.cfg.in b/pki/base/kra/shared/conf/CS.cfg.in
index fb682d756..c99058b74 100644
--- a/pki/base/kra/shared/conf/CS.cfg.in
+++ b/pki/base/kra/shared/conf/CS.cfg.in
@@ -31,6 +31,7 @@ preop.securitydomain.admin_url=https://[PKI_MACHINE_NAME]:9445
instanceRoot=[PKI_INSTANCE_PATH]
machineName=[PKI_MACHINE_NAME]
instanceId=[PKI_INSTANCE_ID]
+pidDir=[PKI_PIDDIR]
service.machineName=[PKI_MACHINE_NAME]
service.instanceDir=[PKI_INSTANCE_ROOT]
service.securePort=[PKI_AGENT_SECURE_PORT]
diff --git a/pki/base/ocsp/shared/conf/CS.cfg.in b/pki/base/ocsp/shared/conf/CS.cfg.in
index e9455a1f4..c05c23fbb 100644
--- a/pki/base/ocsp/shared/conf/CS.cfg.in
+++ b/pki/base/ocsp/shared/conf/CS.cfg.in
@@ -1,6 +1,7 @@
_000=##
_001=## Online Certificate Status Protocol (OCSP) Responder Configuration File
_002=##
+pidDir=[PKI_PIDDIR]
pkicreate.pki_instance_root=[PKI_INSTANCE_ROOT]
pkicreate.pki_instance_name=[PKI_INSTANCE_ID]
pkicreate.subsystem_type=[PKI_SUBSYSTEM_TYPE]
diff --git a/pki/base/ra/doc/CS.cfg.in b/pki/base/ra/doc/CS.cfg.in
index 498db843f..0581e3a78 100644
--- a/pki/base/ra/doc/CS.cfg.in
+++ b/pki/base/ra/doc/CS.cfg.in
@@ -1,6 +1,7 @@
_000=##
_001=## Registration Authority (RA) Configuration File
_002=##
+pidDir=[PKI_PIDDIR]
pkicreate.pki_instance_root=[PKI_INSTANCE_ROOT]
pkicreate.pki_instance_name=[PKI_INSTANCE_ID]
pkicreate.subsystem_type=[PKI_SUBSYSTEM_TYPE]
diff --git a/pki/base/setup/pkicreate b/pki/base/setup/pkicreate
index a98286e8a..ea9ed9da7 100755
--- a/pki/base/setup/pkicreate
+++ b/pki/base/setup/pkicreate
@@ -435,7 +435,7 @@ my $temp_instance_path = undef; # CA, KRA, OCSP, TKS (Tomcat)
my $webapps_instance_path = undef; # CA, KRA, OCSP, TKS
my $webapps_subsystem_instance_path = undef; # CA, KRA, OCSP, TKS
my $work_instance_path = undef; # CA, KRA, OCSP, TKS (Tomcat)
-my $pki_piddir_path = undef; # RA, TPS
+my $pki_piddir_path = undef; # CA, KRA, OCSP, TKS, RA, TPS
my $pki_lockdir_path = undef; # RA, TPS
# Base instance symbolic link paths
@@ -1638,6 +1638,8 @@ sub initialize_subdirectory_paths
. "-" . $setup_config_name;
$setup_config_subsystem_file_path = $setup_subsystem_path
. "/" . $setup_config_name;
+ $pki_piddir_path = $default_apache_pids_path
+ . "/" . $subsystem_type;
## Initialize subdirectory paths (CA subsystems)
if ($subsystem_type eq $CA) {
@@ -1727,8 +1729,6 @@ sub initialize_subdirectory_paths
. $schemaMods_ldif_base_name;
}
- $pki_piddir_path = $default_apache_pids_path
- . "/" . $subsystem_type;
$pki_lockdir_path = $default_lockdir
. "/" . $subsystem_type;
$pki_apache_initscript_file_path = $pki_subsystem_common_area
@@ -2429,6 +2429,7 @@ sub process_pki_templates
$slot_hash{$PKI_REGISTRY_FILE_SLOT} = $pki_registry_instance_file_path;
$slot_hash{$PKI_USER_SLOT} = $pki_user;
$slot_hash{$PKI_GROUP_SLOT} = $pki_group;
+ $slot_hash{$PKI_PIDDIR} = $pki_piddir_path;
if ($subsystem_type eq $TPS) {
$slot_hash{$REQUIRE_CFG_PL} = "require \"${cgi_sow_instance_cfg_pl_path}\";";
@@ -2453,7 +2454,6 @@ sub process_pki_templates
$slot_hash{$TPS_DIR} = $pki_subsystem_path;
$slot_hash{$PKI_FLAVOR_SLOT} = $pki_flavor;
$slot_hash{$PKI_RANDOM_NUMBER_SLOT} = $random;
- $slot_hash{$PKI_PIDDIR} = $pki_piddir_path;
$slot_hash{$PKI_LOCKDIR} = $pki_lockdir_path;
if (is_Fedora() || (is_RHEL() && (! is_RHEL4()))) {
$slot_hash{$FORTITUDE_APACHE} = "Apache2";
diff --git a/pki/base/tks/shared/conf/CS.cfg.in b/pki/base/tks/shared/conf/CS.cfg.in
index f06b2c5d0..213b7645f 100644
--- a/pki/base/tks/shared/conf/CS.cfg.in
+++ b/pki/base/tks/shared/conf/CS.cfg.in
@@ -1,6 +1,7 @@
_000=##
_001=## Token Key Service (TKS) Configuration File
_002=##
+pidDir=[PKI_PIDDIR]
pkicreate.pki_instance_root=[PKI_INSTANCE_ROOT]
pkicreate.pki_instance_name=[PKI_INSTANCE_ID]
pkicreate.subsystem_type=[PKI_SUBSYSTEM_TYPE]
diff --git a/pki/base/tps/doc/CS.cfg.in b/pki/base/tps/doc/CS.cfg.in
index 5fecf3540..e712934c9 100644
--- a/pki/base/tps/doc/CS.cfg.in
+++ b/pki/base/tps/doc/CS.cfg.in
@@ -1,6 +1,7 @@
_000=##
_001=## Token Processing System (TPS) Configuration File
_002=##
+pidDir=[PKI_PIDDIR]
pkicreate.pki_instance_root=[PKI_INSTANCE_ROOT]
pkicreate.pki_instance_name=[PKI_INSTANCE_ID]
pkicreate.subsystem_type=[PKI_SUBSYSTEM_TYPE]