procd: add missing dependency and fix empty mount triggers
authorDaniel Golle <daniel@makrotopia.org>
Sun, 15 Aug 2021 16:41:59 +0000 (17:41 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 15 Aug 2021 17:08:37 +0000 (18:08 +0100)
procd.sh:
 Instead of triggering on every mount.add event, there should be no
 mount trigger at all in case none of the directories passed to
 procd_add_*_mount_trigger() are located on a mountpoint configured in
 /etc/config/fstab.

uxc:
 add missing dependency on rpcd.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/system/procd/Makefile
package/system/procd/files/procd.sh

index e55d7755ebfb52e6a10641ff80796855f7863e7c..98f1ed1775fb20e721ac977ac8635d0d908ed24e 100644 (file)
@@ -90,7 +90,7 @@ endef
 define Package/uxc
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd
+  DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd +rpcd
   TITLE:=OpenWrt container management
   MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 endef
index 14314bec95587c9e76a368bb7cf0a24107e19a04..3549a5a914b96034fc3a0034a21d8e5086be2e67 100644 (file)
@@ -394,11 +394,15 @@ procd_get_mountpoints() {
 }
 
 _procd_add_restart_mount_trigger() {
-       _procd_add_action_mount_trigger restart $(procd_get_mountpoints "$@")
+       local mountpoints="$(procd_get_mountpoints "$@")"
+       [ "${mountpoints//[[:space:]]}" ] &&
+               _procd_add_action_mount_trigger restart $mountpoints
 }
 
 _procd_add_reload_mount_trigger() {
-       _procd_add_action_mount_trigger reload $(procd_get_mountpoints "$@")
+       local mountpoints="$(procd_get_mountpoints "$@")"
+       [ "${mountpoints//[[:space:]]}" ] &&
+               _procd_add_action_mount_trigger reload $mountpoints
 }
 
 _procd_add_raw_trigger() {