Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-nfdhcpd
Commits
d9361b6e
Commit
d9361b6e
authored
Aug 30, 2012
by
Dimitris Aragriorgs
Browse files
Remove stale pid lock file
Signed-off-by:
Dimitris Aragriorgs
<
dimara@grnet.gr
>
parent
4a3ed624
Changes
1
Hide whitespace changes
Inline
Side-by-side
nfdhcpd
View file @
d9361b6e
...
...
@@ -31,6 +31,7 @@ import traceback
import
subprocess
import
daemon
import
daemon.runner
import
daemon.pidlockfile
import
nfqueue
import
pyinotify
...
...
@@ -953,6 +954,12 @@ if __name__ == "__main__":
if
opts
.
daemonize
:
pidfile
=
daemon
.
pidlockfile
.
TimeoutPIDLockFile
(
config
[
"general"
][
"pidfile"
],
10
)
# Remove any stale PID files, left behind by previous invocations
if
(
daemon
.
runner
.
is_pidfile_stale
(
pidfile
)
or
pidfile
.
read_pid
()
is
None
):
logger
.
warning
(
"Removing stale PID lock file %s"
,
pidfile
.
path
)
pidfile
.
break_lock
()
d
=
daemon
.
DaemonContext
(
pidfile
=
pidfile
,
stdout
=
handler
.
stream
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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