Skip to contentSkip to conversation

package/inadyn: bump version, script refactor, etc.

PATCH Applied Joachim Wiberg 2 participants 11 messages Nov 22, 2021 – Dec 5, 2021

lore
Share & tools
lore
#0 lore raw

cover package/inadyn: bump version, script refactor, etc.

Hi,

this patch series updates In-a-dyn to the latest version, adds myself as co-maintainer, drops the local systemd unit file, and adds a fully rewritten sysv start script with a few more features.

Best regards
/Joachim

Joachim Wiberg (5):
package/inadyn: bump to version 2.9.0
DEVELOPERS: add Joachim Wiberg as co-maintainer for inadyn package/inadyn: replace local systemd unit file with upstream package/inadyn: refactor start script package/inadyn: update inadyn.conf example

 DEVELOPERS                    |  1 +
 package/inadyn/S70inadyn      | 85 ++++++++++++++++++++---------------
 package/inadyn/inadyn.conf    | 25 ++++++++---
 package/inadyn/inadyn.hash    |  4 +-
 package/inadyn/inadyn.mk      |  5 +--
 package/inadyn/inadyn.service | 10 -----
 6 files changed, 74 insertions(+), 56 deletions(-)
 mode change 100644 => 100755 package/inadyn/S70inadyn
 delete mode 100644 package/inadyn/inadyn.service
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/5 package/inadyn: bump to version 2.9.0

Upstream changing to .tar.gz, prepare by dropping INADYN_SOURCE, as suggested by utils/check-package.

See the ChangeLog, or release notes at GitHub, for full details:
https://github.com/troglobit/inadyn/releases/tag/v2.9.0

---
 package/inadyn/inadyn.hash | 4 ++--
 package/inadyn/inadyn.mk   | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
package/inadyn/inadyn.hash +2 -2
index 638f92d119..801400b2f5 100644
@@ -1,5 +1,5 @@
-# From https://github.com/troglobit/inadyn/releases/download/v2.8.1/inadyn-2.8.1.tar.xz.sha256
-sha256  1185a9fb165bfc5f5b5f66f0dd8a695c9bd78d4b20cd162273eeea77f2d2e685  inadyn-2.8.1.tar.xz
+# Upstream .sha256 from GitHub
+sha256  b90c02a4f1964d8c1f3e178b6ef22eb29c689cd9e09669af17a8fd998c87dab5  inadyn-2.9.0.tar.gz
 
 # Locally computed
 sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
package/inadyn/inadyn.mk +1 -2
index c115e8926d..fc04fd5f25 100644
@@ -4,9 +4,8 @@
 #
 ################################################################################
 
-INADYN_VERSION = 2.8.1
+INADYN_VERSION = 2.9.0
 INADYN_SITE = https://github.com/troglobit/inadyn/releases/download/v$(INADYN_VERSION)
-INADYN_SOURCE = inadyn-$(INADYN_VERSION).tar.xz
 INADYN_LICENSE = GPL-2.0+
 INADYN_LICENSE_FILES = COPYING
 INADYN_DEPENDENCIES = host-pkgconf libconfuse
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 1/5] package/inadyn: bump to version 2.9.0

Quoted 11 lines · On Mon, 22 Nov 2021 03:08:00 +0100 Joachim Wiberg <[email protected]> wrote:

Upstream changing to .tar.gz, prepare by dropping INADYN_SOURCE, as suggested by utils/check-package.

See the ChangeLog, or release notes at GitHub, for full details:
https://github.com/troglobit/inadyn/releases/tag/v2.9.0

---
 package/inadyn/inadyn.hash | 4 ++--
 package/inadyn/inadyn.mk   | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

Applied to next, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 2/5 DEVELOPERS: add Joachim Wiberg as maintainer for inadyn

In reply to Joachim Wiberg

Upstream maintainer, now also maintainer in Buildroot.

---
 DEVELOPERS | 1 +
 1 file changed, 1 insertion(+)
DEVELOPERS +1 -0
index 6f812eb564..026ce8a9b4 100644
@@ -1343,6 +1343,7 @@ F:	package/rtty/
 N:	Joachim Wiberg <[email protected]>
 F:	configs/globalscale_espressobin_defconfig
 F:	board/globalscale/espressobin/
+F:	package/inadyn/
 F:	package/libite/
 F:	package/libteam/
 F:	package/libuev/
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH 2/5] DEVELOPERS: add Joachim Wiberg as maintainer for inadyn

Quoted 6 lines · On Mon, 22 Nov 2021 03:08:01 +0100 Joachim Wiberg <[email protected]> wrote:

Upstream maintainer, now also maintainer in Buildroot.

---
 DEVELOPERS | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH 3/5 package/inadyn: replace local systemd unit file with upstream

In reply to Joachim Wiberg

If systemd is available at configure time, the inadyn configure script detects it and generates the unit file.

Also, the local unit file had the wrong absolute path to the binary.

---
 package/inadyn/inadyn.mk      |  2 +-
 package/inadyn/inadyn.service | 10 ----------
 2 files changed, 1 insertion(+), 11 deletions(-)
 delete mode 100644 package/inadyn/inadyn.service
package/inadyn/inadyn.mk +1 -1
index fc04fd5f25..9ccb16ddfe 100644
@@ -31,7 +31,7 @@ define INADYN_INSTALL_INIT_SYSV
 endef
 
 define INADYN_INSTALL_INIT_SYSTEMD
-	$(INSTALL) -D -m 644 package/inadyn/inadyn.service \
+	$(INSTALL) -D -m 644 $(@D)/inadyn.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/inadyn.service
 endef
 
package/inadyn/inadyn.service deleted +0 -10
deleted file mode 100644
index abc0a1e401..0000000000
@@ -1,10 +0,0 @@
-[Unit]
-Description=DDNS client
-After=syslog.target network.target
-
-[Service]
-ExecStart=/usr/bin/inadyn
-Restart=always
-
-[Install]
-WantedBy=multi-user.target
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw

Re: [Buildroot] [PATCH 3/5] package/inadyn: replace local systemd unit file with upstream

Quoted 11 lines · On Mon, 22 Nov 2021 03:08:02 +0100 Joachim Wiberg <[email protected]> wrote:

If systemd is available at configure time, the inadyn configure script detects it and generates the unit file.

Also, the local unit file had the wrong absolute path to the binary.

---
 package/inadyn/inadyn.mk      |  2 +-
 package/inadyn/inadyn.service | 10 ----------
 2 files changed, 1 insertion(+), 11 deletions(-)
 delete mode 100644 package/inadyn/inadyn.service

Applied to next, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

PATCH 4/5 package/inadyn: refactor start script

In reply to Joachim Wiberg

This patch is a complete rewrite of the start script, reducing code duplication by using a helper cmd() function and adding support for:

- INADYN_ARGS that can be overridden from /etc/default/inadyn
- reload command that sends SIGHUP

---
 package/inadyn/S70inadyn | 85 +++++++++++++++++++++++-----------------
 1 file changed, 49 insertions(+), 36 deletions(-)
 mode change 100644 => 100755 package/inadyn/S70inadyn
package/inadyn/S70inadyn +49 -36
old mode 100644
new mode 100755
index ca7b414678..1eab33b5fc
@@ -1,44 +1,57 @@
 #!/bin/sh
 #
-# Start & stop the inadyn client
-#
+# Note: must be explicitly enabled by adding ENABLED="yes"
+#       to /etc/default/inadyn, which also can be used to
+#       override the default INADYN_ARGS
 
-CONFIG=/etc/inadyn.conf
+NAME="inadyn"
+INADYN_ARGS="-s"
+PIDFILE="/var/run/$NAME.pid"
 
-# check if CONFIG exists, print message & exit if it doesn't
-[ ! -f $CONFIG ] && ( echo "The config file "$CONFIG" is missing...exiting now." && exit 2 )
+# shellcheck source=/dev/null
+[ -r "/etc/default/$NAME" ] && . "/etc/default/$NAME"
 
-# Allow a few customizations from a config file. Especially inadyn
-# must be explicitly enabled by adding ENABLED="yes" in this file.
-test -r /etc/default/inadyn && . /etc/default/inadyn
+cmd()
+{
+    if [ "$ENABLED" != "yes" ]; then
+	echo "SKIPPED"
+	exit 0
+    fi
+    start-stop-daemon -q -p "$PIDFILE" -x "/usr/sbin/$NAME" "$@"
+    status=$?
+    if [ $status -eq 0 ]; then
+	echo "OK"
+    else
+	echo "FAIL"
+    fi
+    return $status
+}
 
 case "$1" in
-	start)
-		printf "Starting inadyn: "
-		if test "${ENABLED}" != "yes" ; then
-		    echo "SKIPPED"
-		    exit 0
-		fi
-		start-stop-daemon -b -q -S -p /var/run/inadyn.pid -x /usr/sbin/inadyn
-		[ $? = 0 ] && echo "OK" || echo "FAIL"
-		;;
-	stop)
-		printf "Stopping inadyn: "
-		if test "${ENABLED}" != "yes" ; then
-		    echo "SKIPPED"
-		    exit 0
-		fi
-		start-stop-daemon -q -K -p /var/run/inadyn.pid -x /usr/sbin/inadyn
-		[ $? = 0 ] && echo "OK" || echo "FAIL"
-		rm -f /var/run/inadyn.pid
-		;;
-	restart)
-		"$0" stop
-		"$0" start
-		;;
-		*)
-		echo "Usage: $0 {start|stop|restart}"
-		exit 1
-esac
+    start)
+	printf 'Starting %s: ' "$NAME"
+	# shellcheck disable=SC2086 # we need the word splitting
+	cmd -S -- $INADYN_ARGS
+	;;
+
+    stop)
+	printf 'Stopping %s: ' "$NAME"
+	cmd -K
+	rm -f "$PIDFILE"
+	;;
 
-exit $?
+    restart)
+	$0 stop
+	sleep 1
+	$0 start
+	;;
+
+    reload)
+	printf 'Reloading %s: ' "$NAME"
+	cmd -K -s HUP
+	;;
+
+    *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+esac
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

Re: [Buildroot] [PATCH 4/5] package/inadyn: refactor start script

Hello Joachim,

Quoted 7 lines · On Mon, 22 Nov 2021 03:08:03 +0100 Joachim Wiberg <[email protected]> wrote:

This patch is a complete rewrite of the start script, reducing code duplication by using a helper cmd() function and adding support for:

- INADYN_ARGS that can be overridden from /etc/default/inadyn
- reload command that sends SIGHUP

Actually, for init script, we are now trying to use a common style and construction for all, based on package/busybox/S01syslogd.

We don't want each init script of each package to be its own creative work of art, but instead we prefer consistency.

It would actually be good to document this in the Buildroot manual.

Could you try to rework your init script according to package/busybox/S01syslogd ?

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw

Re: [Buildroot] [PATCH 4/5] package/inadyn: refactor start script

Hi Thomas!

Quoted 7 lines · Thomas Petazzoni
Quoted 3 lines · On Mon, 22 Nov 2021 03:08:03 +0100 Joachim Wiberg <[email protected]> wrote:

This patch is a complete rewrite of the start script, reducing code duplication by using a helper cmd() function and adding support for:
[snip]

Actually, for init script, we are now trying to use a common style and construction for all, based on package/busybox/S01syslogd.

Ah, I was actually wondering about that, couldn't find any info on it though.

Quoted 2 lines

We don't want each init script of each package to be its own creative work of art, but instead we prefer consistency.

Understandable. That's good policy actually.

Quoted 1 line

It would actually be good to document this in the Buildroot manual.

I'll see if I can whip something up :)

Quoted 2 lines

Could you try to rework your init script according to package/busybox/S01syslogd ?

Sure, no problem!

Best regards
/Joachim

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#10 lore raw

PATCH 5/5 package/inadyn: update inadyn.conf example

In reply to Joachim Wiberg

- Comment out iface setting, usually not what you want
- Update DynDNS example, show use of multiple hostnames
- Add FreeDNS sample config, free and stable service
- Add link to syntax and examples

---
 package/inadyn/inadyn.conf | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)
package/inadyn/inadyn.conf +20 -5
index 1b29027606..3328ee2218 100644
@@ -1,11 +1,26 @@
-# Basic configuration file for inadyn
+# Example /etc/inadyn.conf
 #
-# /etc/inadyn.conf
-iface    = eth0
+# Remember to change this file to match your provider and credentials
+# Username and password can be included from another file.  For more
+# info, see https://man.troglobit.com/man5/inadyn.conf.5.html
+
+# Use IP address of interface instead of external checkip server.
+# Useful when you want to register internal IP addresses
+#iface    = eth0
+
+# IP address change check interval
 period   = 300
 
-provider [email protected] {
+# Remove of change to match your Dyn account
+provider dyndns.org {
 	username    = test
 	password    = test
-	hostname    = test
+	hostname    = { "my.example.com", "other.example.org" }
+}
+
+# Remove or change to match your FreeDNS account
+provider freedns {
+     username   = lower-case-username
+     password   = case-sensitive-pwd
+     hostname   = some.example.com
 }
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot