Skip to content

Commit c503be9

Browse files
author
Brett Bethke
committed
Add systemd notification support.
This allows running crossbar as a systemd service unit that notifies systemd when it is up and running. This allows other services that depend on crossbar being up to be started correctly.
1 parent 7793990 commit c503be9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

crossbar/controller/node.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,15 @@ def start(self, cdc_mode=False):
495495

496496
try:
497497
yield self._startup(self._config)
498+
499+
# Notify systemd that crossbar is fully up and running
500+
# This has no effect on non-systemd platforms
501+
try:
502+
import sdnotify
503+
sdnotify.SystemdNotifier().notify("READY=1")
504+
except:
505+
pass
506+
498507
except ApplicationError as e:
499508
panic = True
500509
self.log.error("{msg}", msg=e.error_message())

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
'pygments>=2.0.2', # BSD license
7272
'pyyaml>=3.11', # MIT license
7373
'shutilwhich>=1.1.0', # PSF license
74+
'sdnotify>=0.3.0', # MIT license
7475

7576
'psutil>=3.2.1', # BSD license
7677
'lmdb>=0.88', # OpenLDAP BSD

0 commit comments

Comments
 (0)