From: Roy Marples Date: Fri, 23 Dec 2022 16:42:23 +0000 (+0000) Subject: hooks: Use --no-block for systemd X-Git-Tag: v10.0.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0aa82e786f243901a63060becfa789a0e1b0395;p=thirdparty%2Fdhcpcd.git hooks: Use --no-block for systemd As we really don't want to block dhcpcd if systemd does. Fixes #141. --- diff --git a/hooks/50-timesyncd.conf b/hooks/50-timesyncd.conf index 8ebd09c1..c826804f 100644 --- a/hooks/50-timesyncd.conf +++ b/hooks/50-timesyncd.conf @@ -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 } diff --git a/hooks/dhcpcd-run-hooks.in b/hooks/dhcpcd-run-hooks.in index b0dc2ea5..91df64b1 100644 --- a/hooks/dhcpcd-run-hooks.in +++ b/hooks/dhcpcd-run-hooks.in @@ -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 ]; }