procd: change procd_add_start_mount_trigger to do restart
authorDaniel Golle <daniel@makrotopia.org>
Sun, 8 Aug 2021 13:47:54 +0000 (14:47 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 8 Aug 2021 14:26:28 +0000 (15:26 +0100)
Change procd_add_start_mount_trigger to procd_add_restart_mount_trigger
and make it call 'restart' instead of 'start'.
This is more useful as it allows to handle both cases, intial start of
a services as well as restarting services. Calling 'restart' on a
service which has not yet been started has the same result as calling
'start'.

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

index de30c76878bf75b98d02a824ebd77114c9ef622b..14314bec95587c9e76a368bb7cf0a24107e19a04 100644 (file)
@@ -393,8 +393,8 @@ procd_get_mountpoints() {
        ) | sort -u
 }
 
-_procd_add_start_mount_trigger() {
-       _procd_add_action_mount_trigger start $(procd_get_mountpoints "$@")
+_procd_add_restart_mount_trigger() {
+       _procd_add_action_mount_trigger restart $(procd_get_mountpoints "$@")
 }
 
 _procd_add_reload_mount_trigger() {
@@ -636,7 +636,7 @@ _procd_wrapper \
        procd_add_reload_trigger \
        procd_add_reload_interface_trigger \
        procd_add_reload_mount_trigger \
-       procd_add_start_mount_trigger \
+       procd_add_restart_mount_trigger \
        procd_open_trigger \
        procd_close_trigger \
        procd_open_instance \