* [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script
@ 2025-12-27 22:37 Fiona Klute via buildroot
2025-12-27 22:37 ` [Buildroot] [PATCH 2/2] package/libiio: move iiod init script from S99 to S60 Fiona Klute via buildroot
2025-12-29 16:31 ` [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script Thomas Petazzoni via buildroot
0 siblings, 2 replies; 3+ messages in thread
From: Fiona Klute via buildroot @ 2025-12-27 22:37 UTC (permalink / raw)
To: buildroot; +Cc: Paul Cercueil, Fiona Klute
* Fix check-package issues and remove .checkpackageignore entry
* Remove fixed wait in "restart", wait for process termination in
"stop" instead
* Print standard starting/stopping messages
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
.checkpackageignore | 1 -
package/libiio/S99iiod | 62 ++++++++++++++++++++++++++++++------------
2 files changed, 44 insertions(+), 19 deletions(-)
diff --git a/.checkpackageignore b/.checkpackageignore
index d28b22ad74..bafc256c37 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -552,7 +552,6 @@ package/libgpiod/0001-build-add-a-configure-switch-for-building-examples.patch l
package/libgsm/0001-Misc-fixes-from-Archlinux.patch lib_patch.Upstream
package/libgtk3/0001-Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch lib_patch.Upstream
package/libhdhomerun/0001-dont-strip.patch lib_patch.Upstream
-package/libiio/S99iiod Shellcheck lib_sysv.Variables
package/libiqrf/0001-cmake-handle-static-library-and-find-required-thread.patch lib_patch.Upstream
package/libiqrf/0002-use-only-c-language.patch lib_patch.Upstream
package/libjson/0001-fix-broken-makefile.patch lib_patch.Upstream
diff --git a/package/libiio/S99iiod b/package/libiio/S99iiod
index df2f763461..b1d56a73fa 100644
--- a/package/libiio/S99iiod
+++ b/package/libiio/S99iiod
@@ -1,29 +1,55 @@
#!/bin/sh
+DAEMON="iiod"
+PIDFILE="/var/run/$DAEMON.pid"
+
# Server-side demuxing by default
-IIOD_OPTS=-D
+IIOD_OPTS="-D"
-[ -r /etc/default/iiod ] && . /etc/default/iiod
+# shellcheck source=/dev/null
+[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
-case "$1" in
- start)
- echo "Starting IIO Server Daemon"
- start-stop-daemon -S -b -q -m -p /var/run/iiod.pid -x /usr/sbin/iiod -- $IIOD_OPTS
- exit $?
- ;;
+start() {
+ printf 'Starting %s: ' "$DAEMON"
+ # shellcheck disable=SC2086 # we need the word splitting
+ start-stop-daemon --start --background --make-pidfile \
+ --pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON" \
+ -- $IIOD_OPTS
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return "$status"
+}
- stop)
- echo "Stopping IIO Server Daemon"
- start-stop-daemon -K -q -p /var/run/iiod.pid 2>/dev/null
- exit $?
- ;;
+stop() {
+ printf 'Stopping %s: ' "$DAEMON"
+ start-stop-daemon --stop --pidfile "$PIDFILE" --exec "/usr/sbin/$DAEMON"
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ return "$status"
+ fi
+ while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \
+ --exec "/usr/sbin/$DAEMON"; do
+ sleep 0.1
+ done
+ rm -f "$PIDFILE"
+ return "$status"
+}
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
+restart() {
+ stop
+ start
+}
+case "$1" in
+ start|stop|restart)
+ "$1";;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Buildroot] [PATCH 2/2] package/libiio: move iiod init script from S99 to S60
2025-12-27 22:37 [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script Fiona Klute via buildroot
@ 2025-12-27 22:37 ` Fiona Klute via buildroot
2025-12-29 16:31 ` [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script Thomas Petazzoni via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Fiona Klute via buildroot @ 2025-12-27 22:37 UTC (permalink / raw)
To: buildroot; +Cc: Paul Cercueil, Fiona Klute
Running in S99 makes it impossible to start any service that uses iiod
after it, at least by numerical ordering only. Move it forward to
change that.
There are two dependencies of iiod:
1. The IIO devices that it should expose must be available.
2. Network must be up, which means firewall at least should be.
The former may be covered by loading modules, e.g. using S11modules
from package/initscripts. There are different ways to handle network
setup, but with SysV init scripts they generally run before S50.
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
The exact number is certainly debatable, but looking at other services
like sshd (S50) and docker (S60) it doesn't seem too early. Of course,
there are also weird mismatches between similar services like
S50postgresql (package/postgresql) and S97mysqld (package/mariadb), so
clearly there's a good bit of gut feeling in the numbering.
If anyone's interested in what service I might want to run using iiod,
see: https://codeberg.org/airtower/iio-rrd-bridge
package/libiio/{S99iiod => S60iiod} | 0
package/libiio/libiio.mk | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
rename package/libiio/{S99iiod => S60iiod} (100%)
diff --git a/package/libiio/S99iiod b/package/libiio/S60iiod
similarity index 100%
rename from package/libiio/S99iiod
rename to package/libiio/S60iiod
diff --git a/package/libiio/libiio.mk b/package/libiio/libiio.mk
index b85bb9786a..b27532579e 100644
--- a/package/libiio/libiio.mk
+++ b/package/libiio/libiio.mk
@@ -100,8 +100,8 @@ endif
ifeq ($(BR2_PACKAGE_LIBIIO_IIOD),y)
define LIBIIO_INSTALL_INIT_SYSV
- $(INSTALL) -D -m 0755 package/libiio/S99iiod \
- $(TARGET_DIR)/etc/init.d/S99iiod
+ $(INSTALL) -D -m 0755 package/libiio/S60iiod \
+ $(TARGET_DIR)/etc/init.d/S60iiod
endef
endif
--
2.51.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script
2025-12-27 22:37 [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script Fiona Klute via buildroot
2025-12-27 22:37 ` [Buildroot] [PATCH 2/2] package/libiio: move iiod init script from S99 to S60 Fiona Klute via buildroot
@ 2025-12-29 16:31 ` Thomas Petazzoni via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-12-29 16:31 UTC (permalink / raw)
To: Fiona Klute via buildroot; +Cc: Fiona Klute, Paul Cercueil
On Sat, 27 Dec 2025 23:37:32 +0100
Fiona Klute via buildroot <buildroot@buildroot.org> wrote:
> * Fix check-package issues and remove .checkpackageignore entry
>
> * Remove fixed wait in "restart", wait for process termination in
> "stop" instead
>
> * Print standard starting/stopping messages
>
> Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
> ---
> .checkpackageignore | 1 -
> package/libiio/S99iiod | 62 ++++++++++++++++++++++++++++++------------
> 2 files changed, 44 insertions(+), 19 deletions(-)
Thanks, both applied!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-29 16:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-27 22:37 [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script Fiona Klute via buildroot
2025-12-27 22:37 ` [Buildroot] [PATCH 2/2] package/libiio: move iiod init script from S99 to S60 Fiona Klute via buildroot
2025-12-29 16:31 ` [Buildroot] [PATCH 1/2] package/libiio: refactor iiod init script Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox