mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
15
install/restart_scripts/Makefile.am
Normal file
15
install/restart_scripts/Makefile.am
Normal 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
|
||||
2
install/restart_scripts/README
Normal file
2
install/restart_scripts/README
Normal 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.
|
||||
13
install/restart_scripts/restart_dirsrv
Normal file
13
install/restart_scripts/restart_dirsrv
Normal 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))
|
||||
7
install/restart_scripts/restart_httpd
Normal file
7
install/restart_scripts/restart_httpd
Normal 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)
|
||||
Reference in New Issue
Block a user