package/owfs: delay sysvinit start until after network and avahi
authorArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tue, 23 Apr 2019 11:35:15 +0000 (13:35 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 6 May 2019 19:28:33 +0000 (21:28 +0200)
In its default configuration, owserver opens a TCP socket on the 'lo'
interface. However, in some situations, the 'lo' interface may not yet
be up until S40network is started. This causes owserver not to start its
TCP socket, which makes it impossible for the owfs client to connect to
it.

In addition, owserver may have avahi integration.

Therefore, delay the start of owserver and owfs until after S40network
and S50avahi-daemon.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/owfs/S25owserver [deleted file]
package/owfs/S30owfs [deleted file]
package/owfs/S55owserver [new file with mode: 0644]
package/owfs/S60owfs [new file with mode: 0644]
package/owfs/owfs.mk

diff --git a/package/owfs/S25owserver b/package/owfs/S25owserver
deleted file mode 100644 (file)
index b8da768..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-NAME="owserver"
-DAEMON="/usr/bin/${NAME}"
-PID_F="/run/${NAME}.pid"
-
-OWSERVER_ARGS=
-[ -r /etc/default/${NAME} ] && . /etc/default/${NAME}
-
-case "$1" in
-start)
-       printf "Starting ${NAME}: "
-       if [ -z "${OWSERVER_ARGS}" ]; then
-               echo "OWSERVER_ARGS must be set in defaults file" 1>&2
-               exit 1
-       fi
-       start-stop-daemon -S -x ${DAEMON} -- \
-               --pid_file ${PID_F} ${OWSERVER_ARGS}
-       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
-       ;;
-stop)
-       printf "Stopping ${NAME}: "
-       start-stop-daemon -K -p ${PID_F}
-       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
-       ;;
-restart|reload)
-       $0 stop
-       $0 start
-       ;;
-*)
-       echo "Usage: $0 {start|stop|restart|reload}"
-       exit 1
-esac
diff --git a/package/owfs/S30owfs b/package/owfs/S30owfs
deleted file mode 100644 (file)
index feed676..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-NAME="owfs"
-DAEMON="/usr/bin/${NAME}"
-PID_F="/run/${NAME}.pid"
-OWFS_MOUNTPOINT="/dev/1wire"
-OWFS_DEVICES="-s localhost:4304"
-OWFS_ARGS=""
-
-[ -r /etc/default/${NAME} ] && . /etc/default/${NAME}
-
-case "$1" in
-start)
-       printf "Starting ${NAME}: "
-       # Fuse may be in a module, so try to load it
-       modprobe -q fuse && printf "[fuse] "
-       mkdir -p ${OWFS_MOUNTPOINT}
-       start-stop-daemon -S -x ${DAEMON} -- \
-               --pid_file ${PID_F} -m ${OWFS_MOUNTPOINT} ${OWFS_DEVICES} \
-               ${OWFS_ARGS}
-       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
-       ;;
-stop)
-       printf "Stopping ${NAME}: "
-       start-stop-daemon -K -p ${PID_F}
-       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
-       ;;
-restart|reload)
-       $0 stop
-       $0 start
-       ;;
-*)
-       echo "Usage: $0 {start|stop|restart|reload}"
-       exit 1
-esac
diff --git a/package/owfs/S55owserver b/package/owfs/S55owserver
new file mode 100644 (file)
index 0000000..b8da768
--- /dev/null
@@ -0,0 +1,31 @@
+NAME="owserver"
+DAEMON="/usr/bin/${NAME}"
+PID_F="/run/${NAME}.pid"
+
+OWSERVER_ARGS=
+[ -r /etc/default/${NAME} ] && . /etc/default/${NAME}
+
+case "$1" in
+start)
+       printf "Starting ${NAME}: "
+       if [ -z "${OWSERVER_ARGS}" ]; then
+               echo "OWSERVER_ARGS must be set in defaults file" 1>&2
+               exit 1
+       fi
+       start-stop-daemon -S -x ${DAEMON} -- \
+               --pid_file ${PID_F} ${OWSERVER_ARGS}
+       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
+       ;;
+stop)
+       printf "Stopping ${NAME}: "
+       start-stop-daemon -K -p ${PID_F}
+       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
+       ;;
+restart|reload)
+       $0 stop
+       $0 start
+       ;;
+*)
+       echo "Usage: $0 {start|stop|restart|reload}"
+       exit 1
+esac
diff --git a/package/owfs/S60owfs b/package/owfs/S60owfs
new file mode 100644 (file)
index 0000000..feed676
--- /dev/null
@@ -0,0 +1,33 @@
+NAME="owfs"
+DAEMON="/usr/bin/${NAME}"
+PID_F="/run/${NAME}.pid"
+OWFS_MOUNTPOINT="/dev/1wire"
+OWFS_DEVICES="-s localhost:4304"
+OWFS_ARGS=""
+
+[ -r /etc/default/${NAME} ] && . /etc/default/${NAME}
+
+case "$1" in
+start)
+       printf "Starting ${NAME}: "
+       # Fuse may be in a module, so try to load it
+       modprobe -q fuse && printf "[fuse] "
+       mkdir -p ${OWFS_MOUNTPOINT}
+       start-stop-daemon -S -x ${DAEMON} -- \
+               --pid_file ${PID_F} -m ${OWFS_MOUNTPOINT} ${OWFS_DEVICES} \
+               ${OWFS_ARGS}
+       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
+       ;;
+stop)
+       printf "Stopping ${NAME}: "
+       start-stop-daemon -K -p ${PID_F}
+       [ $? -eq 0 ] && echo "OK" || echo "FAIL"
+       ;;
+restart|reload)
+       $0 stop
+       $0 start
+       ;;
+*)
+       echo "Usage: $0 {start|stop|restart|reload}"
+       exit 1
+esac
index cd1c2dba6d19aa5ad1686862716cdb3af98bcb0f..fccc2efa58d06d8b39c9741155f55a2f595cbd1b 100644 (file)
@@ -31,8 +31,8 @@ OWFS_CONF_OPTS += \
        --with-fuseinclude=$(STAGING_DIR)/usr/include \
        --with-fuselib=$(STAGING_DIR)/usr/lib
 define OWFS_INSTALL_FUSE_INIT_SYSV
-       $(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S30owfs \
-               $(TARGET_DIR)/etc/init.d/S30owfs
+       $(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S60owfs \
+               $(TARGET_DIR)/etc/init.d/S60owfs
 endef
 define OWFS_CREATE_MOUNTPOINT
        mkdir -p $(TARGET_DIR)/dev/1wire
@@ -102,8 +102,8 @@ endif
 OWFS_MAKE = $(MAKE) $(OWFS_EXTRA_MAKE_OPTS)
 
 define OWFS_INSTALL_INIT_SYSV
-       $(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S25owserver \
-               $(TARGET_DIR)/etc/init.d/S25owserver
+       $(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S55owserver \
+               $(TARGET_DIR)/etc/init.d/S55owserver
        $(OWFS_INSTALL_FUSE_INIT_SYSV)
 endef