autossh: switch to procd
authorJan Pavlinec <jan.pavlinec@nic.cz>
Fri, 28 Aug 2020 12:13:39 +0000 (14:13 +0200)
committerRosen Penev <rosenp@gmail.com>
Mon, 31 Aug 2020 14:05:12 +0000 (07:05 -0700)
Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
net/autossh/Makefile
net/autossh/files/autossh.init

index a483991a1a2925dfc1775c8060f2ba835f98b193..78dc90ecabeee1c53af9a4fa4fb20b95c6a5d26e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=autossh
 PKG_VERSION:=1.4g
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=https://www.harding.motd.ca/autossh/
index e21b3910befd590c83f75922513a5b12f9e55b3c..f73e415734277ac7832ac7055473f3a8017b3684 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2007-2011 OpenWrt.org
 
+USE_PROCD=1
 START=80
 
 start_instance() {
@@ -14,20 +15,15 @@ start_instance() {
 
        [ "$enabled" = 1 ] || exit 0
 
-       export AUTOSSH_GATETIME="${gatetime:-30}"
-       export AUTOSSH_POLL="${poll:-600}"
-       service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh}
+       procd_open_instance
+       procd_set_param command /usr/sbin/autossh -M ${monitorport:-20000} ${ssh}
+       procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
+       procd_set_param env AUTOSSH_GATETIME="${gatetime:-30}"
+       procd_set_param env AUTOSSH_POLL="${poll:-600}"
+       procd_close_instance
 }
 
-boot() {
-       return
-}
-
-start() {
+start_service() {
        config_load 'autossh'
        config_foreach start_instance 'autossh'
 }
-
-stop() {
-       service_stop /usr/sbin/autossh
-}