From eb2263e0ea56085c521385616eb5f3860ee3beda Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Thu, 17 Oct 2019 12:46:10 +0100 Subject: [PATCH] Client: add avahi-daemon to restart when restarting network --- Drone/copter_client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Drone/copter_client.py b/Drone/copter_client.py index 74a4f69..1f2c0a6 100644 --- a/Drone/copter_client.py +++ b/Drone/copter_client.py @@ -21,8 +21,6 @@ import tf2_ros static_bloadcaster = tf2_ros.StaticTransformBroadcaster() -import threading - # logging.basicConfig( # TODO all prints as logs # level=logging.DEBUG, # INFO # format="%(asctime)s [%(name)-7.7s] [%(threadName)-12.12s] [%(levelname)-5.5s] %(message)s", @@ -104,7 +102,6 @@ def restart_service(name): def execute_command(command): os.system(command) - def configure_chrony_ip(ip, path="/etc/chrony/chrony.conf", ip_index=1): try: with open(path, 'r') as f: @@ -228,7 +225,9 @@ def _response_id(*args, **kwargs): if client.active_client.RESTART_DHCPCD: # client.active_client.server_connection._send_response("new_id") restart_service("dhcpcd") - time.sleep(1.) + time.sleep(0.5) + restart_service("avahi-daemon") + time.sleep(0.5) restart_service("clever") restart_service("smbd") restart_service("clever-show")