Configure certmonger to execute restart scripts on renewal.

certmonger now has the ability to execute a script when it renews a
certificate. This can be used to automatically restart servers so
the certificate doesn't expire in the running server.

https://fedorahosted.org/freeipa/ticket/2050
This commit is contained in:
Rob Crittenden
2012-04-10 21:21:08 +02:00
parent e9b79cc1e1
commit 717bbcd2bf
11 changed files with 73 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
NULL =
appdir = $(libdir)/ipa/certmonger
app_DATA = \
restart_dirsrv \
restart_httpd \
$(NULL)
EXTRA_DIST = \
$(app_DATA) \
$(NULL)
MAINTAINERCLEANFILES = \
*~ \
Makefile.in

View File

@@ -0,0 +1,2 @@
This directory contains scripts to be used by the command (-C) option
of certmonger to restart services when the certificates are renewed.

View File

@@ -0,0 +1,13 @@
#!/usr/bin/python -E
import sys
from ipapython import services as ipaservices
try:
instance = sys.argv[1]
except IndexError:
instance = ""
try:
ipaservices.knownservices.dirsrv.restart(instance)
except Exception, e:
print "Cannot restart dirsrv (instance: '%s'): %s" % (instance, str(e))

View File

@@ -0,0 +1,7 @@
#!/usr/bin/python -E
from ipapython import services as ipaservices
try:
ipaservices.knownservices.httpd.restart()
except Exception, e:
print "Cannot restart httpd: %s" % str(e)