summaryrefslogtreecommitdiffstats
path: root/sshuttle/client.py
diff options
context:
space:
mode:
authorvieira <vieira@yubo.be>2016-10-23 23:12:12 +0000
committerBrian May <brian@linuxpenguins.xyz>2016-10-24 17:54:33 +1100
commitfbbcc05d581d8f822892a05ed5c23f317399d09e (patch)
tree097e795a346108c5aedf426bafdab7975704d8a8 /sshuttle/client.py
parent15b394da86d196a3b959853622afdb71d5453998 (diff)
Support sdnotify for better systemd integration
These changes introduce support for sdnotify allowing sshuttle to notify systemd when it finishes connecting to the server and installing firewall rules, and is ready to tunnel requests.
Diffstat (limited to 'sshuttle/client.py')
-rw-r--r--sshuttle/client.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sshuttle/client.py b/sshuttle/client.py
index 0711912..45788d2 100644
--- a/sshuttle/client.py
+++ b/sshuttle/client.py
@@ -9,6 +9,7 @@ import os
import sshuttle.ssnet as ssnet
import sshuttle.ssh as ssh
import sshuttle.ssyslog as ssyslog
+import sshuttle.sdnotify as sdnotify
import sys
import platform
from sshuttle.ssnet import SockWrapper, Handler, Proxy, Mux, MuxWrapper
@@ -503,6 +504,9 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
debug1('seed_hosts: %r\n' % seed_hosts)
mux.send(0, ssnet.CMD_HOST_REQ, str.encode('\n'.join(seed_hosts)))
+ sdnotify.send(sdnotify.ready(),
+ sdnotify.status('Connected to %s.' % remotename))
+
while 1:
rv = serverproc.poll()
if rv: