Просмотр исходного кода

netifd,lldpd,rpcd,log: use generic service_running

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 <[email protected]>
Petr Štetiar 6 лет назад
Родитель
Сommit
296e1f253c

+ 0 - 5
package/network/config/netifd/files/etc/init.d/network

@@ -40,11 +40,6 @@ stop_service() {
 	sleep 1
 	sleep 1
 }
 }
 
 
-service_running() {
-	ubus -t 30 wait_for network.interface
-	/sbin/wifi reload_legacy
-}
-
 validate_atm_bridge_section()
 validate_atm_bridge_section()
 {
 {
 	uci_validate_section network "atm-bridge" "${1}" \
 	uci_validate_section network "atm-bridge" "${1}" \

+ 0 - 4
package/network/services/lldpd/files/lldpd.init

@@ -96,10 +96,6 @@ start_service() {
 	procd_close_instance
 	procd_close_instance
 }
 }
 
 
-service_running() {
-	pgrep -x /usr/sbin/lldpd &> /dev/null
-}
-
 reload_service() {
 reload_service() {
 	running || return 1
 	running || return 1
 	$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF
 	$LLDPCLI -u $LLDPSOCKET &> /dev/null <<-EOF

+ 0 - 4
package/system/rpcd/files/rpcd.init

@@ -18,7 +18,3 @@ start_service() {
 reload_service() {
 reload_service() {
 	procd_send_signal rpcd
 	procd_send_signal rpcd
 }
 }
-
-service_running() {
-	procd_running rpcd
-}

+ 0 - 4
package/system/ubox/files/log.init

@@ -96,7 +96,3 @@ start_service()
 	config_foreach validate_log_section system start_service_file
 	config_foreach validate_log_section system start_service_file
 	config_foreach validate_log_section system start_service_remote
 	config_foreach validate_log_section system start_service_remote
 }
 }
-
-service_running() {
-	procd_running log
-}