Clean up command sockets on stop

This helps to avoid leaking domain sockets on the filesystem.

Change-Id: I767d66d1cee5e89e2f3c63158bc0cabfa2dd807e
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-01-07 10:02:33 -05:00
parent 6bb3f9d9ea
commit 8f4f827ed3
1 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,9 @@ class CommandSocket(object):
# re-entering their loop.
self.queue.put(b'_stop')
self.socket_thread.join()
self.socket.close()
if os.path.exists(self.path):
os.unlink(self.path)
def _socketListener(self):
while self.running: