]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
hooks: Use --no-block for systemd
authorRoy Marples <roy@marples.name>
Fri, 23 Dec 2022 16:42:23 +0000 (16:42 +0000)
committerRoy Marples <roy@marples.name>
Fri, 23 Dec 2022 16:42:23 +0000 (16:42 +0000)
As we really don't want to block dhcpcd if systemd does.
Fixes #141.

hooks/50-timesyncd.conf
hooks/dhcpcd-run-hooks.in

index 8ebd09c1c590c317d6921484b233954bdfa48364..c826804f7722ef0666e3894d2f6d946d9a187bf4 100644 (file)
@@ -10,7 +10,7 @@ remove_timesyncd_conf()
 {
        if [ -e "$timesyncd_conf" ]; then
                rm "$timesyncd_conf"
-               systemctl try-reload-or-restart systemd-timesyncd
+               systemctl try-reload-or-restart --no-block systemd-timesyncd
        fi
 }
 
@@ -29,7 +29,7 @@ add_timesyncd_conf()
 
        printf %s "$conf" > "$timesyncd_tmp"
        if change_file "$timesyncd_conf" "$timesyncd_tmp"; then
-               systemctl try-reload-or-restart systemd-timesyncd
+               systemctl try-reload-or-restart --no-block systemd-timesyncd
        fi
 }
 
index b0dc2ea51a24c0dc5cf1c4d2c783f307226d241c..91df64b1a8093f94158ec9d1f90c47f16c605023 100644 (file)
@@ -234,11 +234,11 @@ detect_init()
        if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then
                _service_exists="/bin/systemctl --quiet is-enabled \$1.service"
                _service_status="/bin/systemctl --quiet is-active \$1.service"
-               _service_cmd="/bin/systemctl \$2 \$1.service"
+               _service_cmd="/bin/systemctl \$2 --no-block \$1.service"
        elif [ -x /usr/bin/systemctl ] && [ -S /run/systemd/private ]; then
                _service_exists="/usr/bin/systemctl --quiet is-enabled \$1.service"
                _service_status="/usr/bin/systemctl --quiet is-active \$1.service"
-               _service_cmd="/usr/bin/systemctl \$2 \$1.service"
+               _service_cmd="/usr/bin/systemctl \$2 --no-block \$1.service"
        elif [ -x /sbin/rc-service ] &&
             { [ -s /libexec/rc/init.d/softlevel ] ||
             [ -s /run/openrc/softlevel ]; }