summaryrefslogtreecommitdiffstats
path: root/pki/base/ocsp
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/ocsp')
-rw-r--r--pki/base/ocsp/CMakeLists.txt21
-rw-r--r--pki/base/ocsp/shared/conf/CS.cfg.in1
-rw-r--r--pki/base/ocsp/shared/lib/systemd/system/pki-ocspd.target8
-rw-r--r--pki/base/ocsp/shared/lib/systemd/system/pki-ocspd@.service13
4 files changed, 43 insertions, 0 deletions
diff --git a/pki/base/ocsp/CMakeLists.txt b/pki/base/ocsp/CMakeLists.txt
index 1a780907..c8e22ea1 100644
--- a/pki/base/ocsp/CMakeLists.txt
+++ b/pki/base/ocsp/CMakeLists.txt
@@ -4,6 +4,19 @@ add_subdirectory(src)
add_subdirectory(setup)
add_subdirectory(shared/conf)
+# install systemd scripts
+install(
+ FILES
+ shared/lib/systemd/system/pki-ocspd.target
+ shared/lib/systemd/system/pki-ocspd@.service
+ DESTINATION
+ ${SYSTEMD_LIB_INSTALL_DIR}
+ PERMISSIONS
+ OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ GROUP_EXECUTE GROUP_READ
+ WORLD_EXECUTE WORLD_READ
+)
+
# install init script
install(
FILES
@@ -28,6 +41,8 @@ install(
"etc/*" EXCLUDE
PATTERN
"CS.cfg.in" EXCLUDE
+ PATTERN
+ "lib/*" EXCLUDE
)
# install empty directories
@@ -42,3 +57,9 @@ install(
DESTINATION
${VAR_INSTALL_DIR}/run/pki/ocsp
)
+
+install(
+ DIRECTORY
+ DESTINATION
+ ${SYSTEMD_ETC_INSTALL_DIR}/pki-ocspd.target.wants
+)
diff --git a/pki/base/ocsp/shared/conf/CS.cfg.in b/pki/base/ocsp/shared/conf/CS.cfg.in
index 4cd234c8..6d46b790 100644
--- a/pki/base/ocsp/shared/conf/CS.cfg.in
+++ b/pki/base/ocsp/shared/conf/CS.cfg.in
@@ -12,6 +12,7 @@ pkicreate.unsecure_port=[PKI_UNSECURE_PORT]
pkicreate.tomcat_server_port=[TOMCAT_SERVER_PORT]
pkicreate.user=[PKI_USER]
pkicreate.group=[PKI_GROUP]
+pkicreate.systemd.servicename=[PKI_SYSTEMD_SERVICENAME]
pkiremove.cert.subsystem.nickname=subsystemCert cert-[PKI_INSTANCE_ID]
installDate=[INSTALL_TIME]
cs.type=OCSP
diff --git a/pki/base/ocsp/shared/lib/systemd/system/pki-ocspd.target b/pki/base/ocsp/shared/lib/systemd/system/pki-ocspd.target
new file mode 100644
index 00000000..5db6bf4d
--- /dev/null
+++ b/pki/base/ocsp/shared/lib/systemd/system/pki-ocspd.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=PKI Online Certificate Status Protocol Server
+After=syslog.target network.target
+
+[Install]
+WantedBy=multi-user.target
+
+
diff --git a/pki/base/ocsp/shared/lib/systemd/system/pki-ocspd@.service b/pki/base/ocsp/shared/lib/systemd/system/pki-ocspd@.service
new file mode 100644
index 00000000..7b4e7855
--- /dev/null
+++ b/pki/base/ocsp/shared/lib/systemd/system/pki-ocspd@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=PKI Online Certificate Status Protocol Server %i
+After=pki-ocspd.target
+BindTo=pki-ocspd.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/pkicontrol start ocsp %i
+ExecStop=/usr/bin/pkicontrol stop ocsp %i
+
+[Install]
+WantedBy=multi-user.target
+