Fix PID file for Libra tools.
Using the `lockfile` module didn't produce a PID file that contained the process PID number, just an empty .lck file. Using the TimeoutPIDLockFile distributed with the `daemon` module gives us what we expect: a .pid file with the PID number as the contents.
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import daemon
|
||||
import daemon.pidfile
|
||||
import grp
|
||||
import lockfile
|
||||
import pwd
|
||||
import signal
|
||||
import sys
|
||||
@@ -68,7 +68,7 @@ def main():
|
||||
context = daemon.DaemonContext(
|
||||
working_directory='/etc/haproxy',
|
||||
umask=0o022,
|
||||
pidfile=lockfile.FileLock(args.pid),
|
||||
pidfile=daemon.pidfile.TimeoutPIDLockFile(args.pid),
|
||||
files_preserve=[logger.handlers[0].stream]
|
||||
)
|
||||
if args.user:
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
# under the License.
|
||||
|
||||
import daemon
|
||||
import daemon.pidfile
|
||||
import gearman.errors
|
||||
import grp
|
||||
import json
|
||||
import lockfile
|
||||
import pwd
|
||||
import socket
|
||||
from time import sleep
|
||||
@@ -195,7 +195,7 @@ def main():
|
||||
context = daemon.DaemonContext(
|
||||
working_directory='/etc/haproxy',
|
||||
umask=0o022,
|
||||
pidfile=lockfile.FileLock(args.pid),
|
||||
pidfile=daemon.pidfile.TimeoutPIDLockFile(args.pid),
|
||||
files_preserve=[logger.handlers[0].stream]
|
||||
)
|
||||
if args.user:
|
||||
|
||||
Reference in New Issue
Block a user