Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
96391341
Commit
96391341
authored
May 23, 2012
by
Mukund Sivaraman
Browse files
[1704] Delete lock files when BIND 10 shuts down
parent
9427bd41
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/bind10/bind10_src.py.in
View file @
96391341
...
...
@@ -64,6 +64,7 @@ import posix
import copy
from bind10_config import LIBEXECPATH
import bind10_config
import isc.cc
import isc.util.process
import isc.net.parse
...
...
@@ -1122,6 +1123,24 @@ def unlink_pid_file(pid_file):
if error.errno is not errno.ENOENT:
raise
def remove_lock_files():
"""
Remove various lock files which were created by code such as in the
logger. This function should be called after BIND 10 shutdown.
"""
lockfiles = ["logger_lockfile"]
lpath = bind10_config.DATA_PATH
if "B10_FROM_BUILD" in os.environ:
lpath = os.environ["B10_FROM_BUILD"]
if "B10_FROM_SOURCE_LOCALSTATEDIR" in os.environ:
lpath = os.environ["B10_FROM_SOURCE_LOCALSTATEDIR"]
for f in lockfiles:
os.unlink(lpath + '/' + f)
return
def main():
global options
...
...
@@ -1201,6 +1220,7 @@ def main():
finally:
# Clean up the filesystem
unlink_pid_file(options.pid_file)
remove_lock_files()
if boss_of_bind is not None:
boss_of_bind.remove_socket_srv()
sys.exit(boss_of_bind.exitcode)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment