diff options
author | Ade Lee <alee@redhat.com> | 2015-05-06 16:06:34 -0400 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2015-05-10 16:09:24 -0400 |
commit | 7dca020819b7573cd05bd54482fb5d1afe9bb658 (patch) | |
tree | 871e3a9d350c081e52a26b0583bd02e8f2dd761b /base/server/tomcat/src | |
parent | 2db074c39334a6ec48a6fac52722f684a14bb00a (diff) | |
download | pki-7dca020819b7573cd05bd54482fb5d1afe9bb658.tar.gz pki-7dca020819b7573cd05bd54482fb5d1afe9bb658.tar.xz pki-7dca020819b7573cd05bd54482fb5d1afe9bb658.zip |
Patches to get nuxwdog working with systemd
This patch adds some new unit files and targets for starting instances
with nuxwdog, as well as logic within the pki-server nuxwdog module to
switch to/from the old and new systemd unit files.
It also corrects some issues found in additional testing of the nuxwdog
change scripts.
To use nuxwdog to start the instance, a user needs to do the following:
1. Create an instance normally.
2. Run: pki-server instance-nuxwdog-enable <instance_name>
3. Start the instance using:
systemctl start pki-tomcatd-nuxwdog@<instance_name>.service
To revert the instance, simply do the following:
1. Run: pki-server instance-nuxwdog-disable <instance_name>
2. Start the instance using:
systemctl start pki-tomcatd@<instance_name>.service
Diffstat (limited to 'base/server/tomcat/src')
-rw-r--r-- | base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStore.java | 7 | ||||
-rw-r--r-- | base/server/tomcat/src/com/netscape/cms/tomcat/PKIListener.java (renamed from base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStoreInitializer.java) | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStore.java b/base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStore.java index 33cfc8a85..61329d80f 100644 --- a/base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStore.java +++ b/base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStore.java @@ -23,6 +23,7 @@ public class NuxwdogPasswordStore implements org.apache.tomcat.util.net.jss.IPas private ArrayList<String> tags = null; private final String PROMPT_PREFIX = "Please provide the password for "; + private String instanceId; @Override public void init(String confFile) throws IOException { @@ -62,6 +63,8 @@ public class NuxwdogPasswordStore implements org.apache.tomcat.util.net.jss.IPas tags.add("hardware-" + token); } } + + instanceId = props.getProperty("instanceId"); } private void addTag(String tag) { @@ -76,6 +79,10 @@ public class NuxwdogPasswordStore implements org.apache.tomcat.util.net.jss.IPas } String prompt = PROMPT_PREFIX + tag + ":"; + if (StringUtils.isNotEmpty(instanceId)) { + prompt = "[" + instanceId + "] " + prompt; + } + String pwd = WatchdogClient.getPassword(prompt, iteration); if (pwd != null) { diff --git a/base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStoreInitializer.java b/base/server/tomcat/src/com/netscape/cms/tomcat/PKIListener.java index a4c25306d..abd88c1a6 100644 --- a/base/server/tomcat/src/com/netscape/cms/tomcat/NuxwdogPasswordStoreInitializer.java +++ b/base/server/tomcat/src/com/netscape/cms/tomcat/PKIListener.java @@ -6,7 +6,7 @@ import org.apache.commons.lang.StringUtils; import com.redhat.nuxwdog.WatchdogClient; -public class NuxwdogPasswordStoreInitializer implements LifecycleListener { +public class PKIListener implements LifecycleListener { private boolean startedByWD = false; |