postmarketos-base-ui: kill/restart unudhcpd unconditionally (MR 4354)

In some cases, the dispatcher script fails if unudhcpd is already running.
Forcefully killing unudhcpd resolves the issue.

Fixes #2267.

Tested-by: Sicelo A. Mhlongo <absicsz@gmail.com>
[ci:skip-build]: already built successfully in CI
This commit is contained in:
Dylan Van Assche 2023-08-28 15:35:38 +02:00 committed by Pablo Correa Gómez
parent 1199feabbd
commit 6002e51b70
No known key found for this signature in database
GPG Key ID: 7A342565FF635F79
2 changed files with 14 additions and 17 deletions

View File

@ -1,6 +1,6 @@
# Maintainer: Clayton Craft <clayton@craftyguy.net> # Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-base-ui pkgname=postmarketos-base-ui
pkgver=13 pkgver=14
pkgrel=0 pkgrel=0
pkgdesc="Meta package for minimal postmarketOS UI base" pkgdesc="Meta package for minimal postmarketOS UI base"
url="https://postmarketos.org" url="https://postmarketos.org"
@ -205,7 +205,7 @@ d4b4c4fed2dee7266f6a87ae266691377593014943e2953e4cd87a59f3110f25bfb5f3f866cc8435
d1ddd43489e6016e3ffd716027ed2bae4a2ab5f213118bdbcb96750e267ab7c0367cd0e0e386300aa5550352653144f5caeddd790621fe0879f83ca1995bb65c rootfs-etc-tinydm.d-env-wayland.d-50-firefox-wayland.sh d1ddd43489e6016e3ffd716027ed2bae4a2ab5f213118bdbcb96750e267ab7c0367cd0e0e386300aa5550352653144f5caeddd790621fe0879f83ca1995bb65c rootfs-etc-tinydm.d-env-wayland.d-50-firefox-wayland.sh
ecaa57d033a119a53a6574c27636b7c89d659d75ea48a973a6a4ff6f90e5d07202529fd489bfc9dfc7430f5b60f40612f6d5c06f7fab47e681b0a3112a874058 rootfs-etc-tinydm.d-env-wayland.d-50-sdl-wayland.sh ecaa57d033a119a53a6574c27636b7c89d659d75ea48a973a6a4ff6f90e5d07202529fd489bfc9dfc7430f5b60f40612f6d5c06f7fab47e681b0a3112a874058 rootfs-etc-tinydm.d-env-wayland.d-50-sdl-wayland.sh
52d58729cbf3cd0318de633e8a8da74c7af246025a8c5746d5e7c854bdabbf27fa07d8558ffec92a30491cdb687fe4414de5adcddd7da5be3510f918fba463a2 rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh 52d58729cbf3cd0318de633e8a8da74c7af246025a8c5746d5e7c854bdabbf27fa07d8558ffec92a30491cdb687fe4414de5adcddd7da5be3510f918fba463a2 rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh
515ede48ce1245e72b501e17e59986d04a26aab9a42881b44974253c7dec1db08658625157d23adb6f8f62fd78c3f93b71fee1894ad0c80d61be3f5f32d5b990 rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh 5b26f7b281b2e61d12afd4a5fa2f4c28ef6d510db7ea2c52bb412cc3ab890af674ab3af7b90e944cc7fe39290cba9999dacbd4372ef081e8cf9bc2caabe0437a rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh
bf8db527c49fa724e640a90269ba2648a2555f5867b2adbfbd88d1f685261f757339757c09ee08f590c76de4bd3d0c73a47dea9bd340644dd4707e76152cefd1 rootfs-etc-profile.d-qt-mobile-controls.sh bf8db527c49fa724e640a90269ba2648a2555f5867b2adbfbd88d1f685261f757339757c09ee08f590c76de4bd3d0c73a47dea9bd340644dd4707e76152cefd1 rootfs-etc-profile.d-qt-mobile-controls.sh
6e193eca3961a78d47b4656892eae34d019d9317a255a201f5ea61e3300caff04c526a27cd98d0edc072b36e3eaf3a1768f4cd27c5e2be8b19c167d535c820a6 rootfs-etc-profile.d-qt-wayland.sh 6e193eca3961a78d47b4656892eae34d019d9317a255a201f5ea61e3300caff04c526a27cd98d0edc072b36e3eaf3a1768f4cd27c5e2be8b19c167d535c820a6 rootfs-etc-profile.d-qt-wayland.sh
" "

View File

@ -55,15 +55,14 @@ disable_tethering() {
nmcli connection modify "$con_uuid" ipv6.method "link-local" nmcli connection modify "$con_uuid" ipv6.method "link-local"
nmcli connection modify "$con_uuid" connection.autoconnect "true" nmcli connection modify "$con_uuid" connection.autoconnect "true"
# If unudhpcd is not running, start it and configure it similar to initfs # Restart unudhpcd and configure it similar to initfs
if [ ! "$(pidof unudhcpd)" ]; then killall unudhpcd || true
(unudhcpd -i "$interface" -s "$host_ip" -c "$client_ip") & (unudhcpd -i "$interface" -s "$host_ip" -c "$client_ip") &
logger -t nm-tethering "unudhcpd started" logger -t nm-tethering "unudhcpd started"
reactivate_gadget
logger -t nm-tethering "USB tethering disabled"
fi
# Reactivate gadget to apply changes
reactivate_gadget
logger -t nm-tethering "USB tethering disabled"
} }
# USB tethering # USB tethering
@ -83,14 +82,12 @@ enable_tethering() {
fi fi
# Kill unudhcpd if needed # Kill unudhcpd if needed
if [ "$(pidof unudhcpd)" ]; then killall unudhcpd || true
killall unudhcpd logger -t nm-tethering "unudhcpd stopped"
logger -t nm-tethering "unudhcpd stopped"
reactivate_gadget
logger -t nm-tethering "USB tethering enabled"
fi
# Reactivate gadget to apply changes
reactivate_gadget
logger -t nm-tethering "USB tethering enabled"
} }
# Handle dispatcher events for tethering # Handle dispatcher events for tethering