summaryrefslogtreecommitdiffstats
path: root/install/restart_scripts/restart_httpd
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2014-01-23 15:33:26 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-03-10 18:41:10 +0100
commit8e986904096925fc08df8cbdf271d722314c5460 (patch)
treead4fca6b98f049a26df5620eb7691d6a491aea3a /install/restart_scripts/restart_httpd
parentd727599aa804aecd91de969a9309c1903d0cfdce (diff)
downloadfreeipa-8e986904096925fc08df8cbdf271d722314c5460.tar.gz
freeipa-8e986904096925fc08df8cbdf271d722314c5460.tar.xz
freeipa-8e986904096925fc08df8cbdf271d722314c5460.zip
Log unhandled exceptions in certificate renewal scripts.
https://fedorahosted.org/freeipa/ticket/4093 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'install/restart_scripts/restart_httpd')
-rw-r--r--install/restart_scripts/restart_httpd15
1 files changed, 11 insertions, 4 deletions
diff --git a/install/restart_scripts/restart_httpd b/install/restart_scripts/restart_httpd
index 16a41ee5b..98337bc85 100644
--- a/install/restart_scripts/restart_httpd
+++ b/install/restart_scripts/restart_httpd
@@ -20,11 +20,18 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import syslog
+import traceback
from ipapython import services as ipaservices
-syslog.syslog(syslog.LOG_NOTICE, 'certmonger restarted httpd')
+def main():
+ syslog.syslog(syslog.LOG_NOTICE, 'certmonger restarted httpd')
+
+ try:
+ ipaservices.knownservices.httpd.restart()
+ except Exception, e:
+ syslog.syslog(syslog.LOG_ERR, "Cannot restart httpd: %s" % str(e))
try:
- ipaservices.knownservices.httpd.restart()
-except Exception, e:
- syslog.syslog(syslog.LOG_ERR, "Cannot restart httpd: %s" % str(e))
+ main()
+except Exception:
+ syslog.syslog(syslog.LOG_ERR, traceback.format_exc())