netifd,lldpd,rpcd,log: use generic service_running
authorPetr Štetiar <ynezz@true.cz>
Tue, 23 Jul 2019 10:16:03 +0000 (12:16 +0200)
committerPetr Štetiar <ynezz@true.cz>
Sun, 15 Sep 2019 20:53:01 +0000 (22:53 +0200)
commit eb204d14f75c ("base-files: implement generic service_running")
introduced generic service_running so it's not needed to copy&paste same
3 lines over and over again.

I've removed service_running from netifd/network init script as well,
because it was not working properly, looked quite strange and I didn't
understand the intention:

 $ /etc/init.d/network stop
 $ service network running && echo "yes" || echo "nope"
     ( have to wait for 30s )
 Command failed: Request timed out
 yes

Signed-off-by: Petr Štetiar <ynezz@true.cz>
package/network/config/netifd/files/etc/init.d/network
package/network/services/lldpd/files/lldpd.init
package/system/rpcd/files/rpcd.init
package/system/ubox/files/log.init

index 2321a309a5ceabea034cf567d8b80850ff4f3b59..dc208c4ce0a1f5982d732860111421257540bfd2 100755 (executable)
@@ -40,11 +40,6 @@ stop_service() {
        sleep 1
 }
 
-service_running() {
-       ubus -t 30 wait_for network.interface
-       /sbin/wifi reload_legacy
-}
-
 validate_atm_bridge_section()
 {
        uci_validate_section network "atm-bridge" "${1}" \
index bc429de484d3f7b47cc557585364aa00fe850673..9fb3a825599555be37e0e57e165cb8453266c658 100644 (file)
@@ -96,10 +96,6 @@ start_service() {
        procd_close_instance
 }
 
-service_running() {
-       pgrep -x /usr/sbin/lldpd &> /dev/null
-}
-
 reload_service() {
        running || return 1
        $LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
index 77ebcbe6cb7b57cf80fb73b782007ab318ef9a78..447133c67a5a639e665fccf8b66efa703760c948 100755 (executable)
@@ -18,7 +18,3 @@ start_service() {
 reload_service() {
        procd_send_signal rpcd
 }
-
-service_running() {
-       procd_running rpcd
-}
index ba9c124c8ba6e71b875685680fde4f268f52659e..250f805b440619a5d799643acb29876af77fc624 100644 (file)
@@ -96,7 +96,3 @@ start_service()
        config_foreach validate_log_section system start_service_file
        config_foreach validate_log_section system start_service_remote
 }
-
-service_running() {
-       procd_running log
-}