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/util/src/com/netscape/cmsutil | |
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/util/src/com/netscape/cmsutil')
3 files changed, 17 insertions, 0 deletions
diff --git a/base/util/src/com/netscape/cmsutil/password/IPasswordStore.java b/base/util/src/com/netscape/cmsutil/password/IPasswordStore.java index 00ec4ccdf..2bae4a5c7 100644 --- a/base/util/src/com/netscape/cmsutil/password/IPasswordStore.java +++ b/base/util/src/com/netscape/cmsutil/password/IPasswordStore.java @@ -31,4 +31,6 @@ public interface IPasswordStore { public void commit() throws IOException, ClassCastException, NullPointerException; + + public void setId(String id); } diff --git a/base/util/src/com/netscape/cmsutil/password/NuxwdogPasswordStore.java b/base/util/src/com/netscape/cmsutil/password/NuxwdogPasswordStore.java index 2a22d9ef6..6db207939 100644 --- a/base/util/src/com/netscape/cmsutil/password/NuxwdogPasswordStore.java +++ b/base/util/src/com/netscape/cmsutil/password/NuxwdogPasswordStore.java @@ -22,6 +22,7 @@ public class NuxwdogPasswordStore implements IPasswordStore { private ArrayList<String> tags = null; private final String PROMPT_PREFIX = "Please provide the password for "; + private String id; @Override public void init(String confFile) throws IOException { @@ -61,6 +62,8 @@ public class NuxwdogPasswordStore implements IPasswordStore { tags.add("hardware-" + token); } } + + id = props.getProperty("instanceId"); } private void addTag(String tag) { @@ -76,6 +79,9 @@ public class NuxwdogPasswordStore implements IPasswordStore { } String prompt = PROMPT_PREFIX + tag + ":"; + if (StringUtils.isNotEmpty(id)) { + prompt = "[" + id + "] " + prompt; + } String pwd = WatchdogClient.getPassword(prompt, iteration); if (pwd != null) { @@ -100,4 +106,8 @@ public class NuxwdogPasswordStore implements IPasswordStore { // Nothing required here } + public void setId(String id) { + this.id = id; + } + } diff --git a/base/util/src/com/netscape/cmsutil/password/PlainPasswordFile.java b/base/util/src/com/netscape/cmsutil/password/PlainPasswordFile.java index a3cd598c5..55f6db041 100644 --- a/base/util/src/com/netscape/cmsutil/password/PlainPasswordFile.java +++ b/base/util/src/com/netscape/cmsutil/password/PlainPasswordFile.java @@ -28,6 +28,7 @@ public class PlainPasswordFile implements IPasswordStore { private String mPwdPath = ""; private Properties mPwdStore; private static final String PASSWORD_WRITER_HEADER = ""; + private String id; public PlainPasswordFile() { mPwdStore = new Properties(); @@ -78,4 +79,8 @@ public class PlainPasswordFile implements IPasswordStore { } } } + + public void setId(String id) { + this.id = id; + } } |