There was an error while loading. Please reload this page.
1 parent f2af3b5 commit d7b6f77Copy full SHA for d7b6f77
1 file changed
cloudbaseinit/shell.py
@@ -12,6 +12,8 @@
12
# License for the specific language governing permissions and limitations
13
# under the License.
14
15
+import atexit
16
+import signal
17
import sys
18
19
from oslo_log import log as oslo_logging
@@ -29,6 +31,20 @@ def main():
29
31
CONF(sys.argv[1:])
30
32
logging.setup('cloudbaseinit')
33
34
+ def atexit_handler():
35
+ LOG.debug("Process is exiting")
36
+ try:
37
+ atexit.register(atexit_handler)
38
+ except Exception as exc:
39
+ LOG.exception(exc)
40
+
41
+ def on_sigterm_handler(sig, frame):
42
+ LOG.debug("Process has received sigterm")
43
44
+ signal.signal(signal.SIGTERM, on_sigterm_handler)
45
46
47
48
try:
49
init.InitManager().configure_host()
50
except Exception as exc:
0 commit comments