mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #10375 from terminalmage/systemd-daemon-notify
On systemd hosts, notify systemd when master is started
This commit is contained in:
commit
baf9b7355f
@ -62,6 +62,13 @@ try:
|
||||
except ImportError:
|
||||
HAS_HALITE = False
|
||||
|
||||
try:
|
||||
import systemd.daemon
|
||||
HAS_PYTHON_SYSTEMD = True
|
||||
except ImportError:
|
||||
HAS_PYTHON_SYSTEMD = False
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -466,6 +473,13 @@ class ReqServer(object):
|
||||
|
||||
self.workers.bind(self.w_uri)
|
||||
|
||||
try:
|
||||
if HAS_PYTHON_SYSTEMD and systemd.daemon.booted():
|
||||
systemd.daemon.notify('READY=1')
|
||||
except SystemError:
|
||||
# Daemon wasn't started by systemd
|
||||
pass
|
||||
|
||||
while True:
|
||||
try:
|
||||
zmq.device(zmq.QUEUE, self.clients, self.workers)
|
||||
|
Loading…
Reference in New Issue
Block a user