s4-python: Override SIGINT handler in scripts only.
[kai/samba.git] / source4 / scripting / bin / smbstatus
index 055753b3fabd5d7cc38f3b5740ed246083cc45cf..7ff98df6b3ed7152f20a9fde4207f86980820f8b 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 #
 #  provide information on connected users and open files
-#  Copyright ǒ Jelmer Vernooij 2008
+#  Copyright (c) Jelmer Vernooij 2008
 #
 #  Based on the original in EJS:
 #  Copyright Andrew Tridgell 2005
 
 import os, sys
 
+# make sure the script dies immediately when hitting control-C,
+# rather than raising KeyboardInterrupt. As we do all database
+# operations using transactions, this is safe.
+import signal
+signal.signal(signal.SIGINT, signal.SIG_DFL)
+
 sys.path.insert(0, "bin/python")
 
 import optparse