From 73d97b1e275df7dd45c58fc478df1002440e0eed Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 9 Jun 2014 12:25:25 +0200 Subject: [PATCH] avoid calling systemctl in helper script --- chrony.helper | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/chrony.helper b/chrony.helper index 8deac0c..c51540d 100644 --- a/chrony.helper +++ b/chrony.helper @@ -3,10 +3,9 @@ chronyc=/usr/bin/chronyc dhclient_servers=/var/lib/dhclient/chrony.servers.* dhclient_added_servers=/var/lib/dhclient/chrony.added_servers -service_name=chronyd.service chrony_command() { - $chronyc -a -m "$1" + $chronyc -a -n -m "$1" } update_dhclient_added_servers() { @@ -49,7 +48,7 @@ remove_dhclient_servers() { } is_running() { - systemctl is-active -q $service_name + chrony_command "tracking" &> /dev/null } case "$1" in @@ -62,10 +61,7 @@ case "$1" in is-running) is_running ;; - command) - is_running && chrony_command "$2" - ;; - forced-command) + command|forced-command) chrony_command "$2" ;; *)