]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Ensure pid file is removed when metadata ns daemon receives SIGTERM
authorDarragh O'Reilly <dara2002-openstack@yahoo.com>
Tue, 10 Sep 2013 09:06:28 +0000 (09:06 +0000)
committerDarragh O'Reilly <dara2002-openstack@yahoo.com>
Tue, 10 Sep 2013 09:06:28 +0000 (09:06 +0000)
commit4535505fc1ee6aae49f3b054cffd48b88f062e31
treeefa44b6bd9c44a1bf6ea46d2a94858deb8ef4612
parentc896e34bd3def5d8df7df36e5b14a8afe9ea9d04
Ensure pid file is removed when metadata ns daemon receives SIGTERM

These files from the metadata namespace proxy are not being removed
because delete_pid() is registered with atexit. This means it only runs
when a process exits normally and won't run when a process receives a
signal.

This patch registers a signal handler for SIGTERM that calls exit()
to make the process exit normally so delete_pid() gets called.

Fixes bug: 1223250

Change-Id: I6309802e2109359560ccc084559ec8e4d310cce2
neutron/agent/linux/daemon.py
neutron/tests/unit/test_linux_daemon.py