From: Arnout Vandecappelle (Essensium/Mind) Date: Tue, 23 Apr 2019 11:35:15 +0000 (+0200) Subject: package/owfs: delay sysvinit start until after network and avahi X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=efc6ccbddc1737a534b2cb54f72bb9c2b2f58461;p=buildroot.git package/owfs: delay sysvinit start until after network and avahi 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) Signed-off-by: Peter Korsgaard --- diff --git a/package/owfs/S25owserver b/package/owfs/S25owserver deleted file mode 100644 index b8da768e96..0000000000 --- a/package/owfs/S25owserver +++ /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 index feed676f8a..0000000000 --- a/package/owfs/S30owfs +++ /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 index 0000000000..b8da768e96 --- /dev/null +++ b/package/owfs/S55owserver @@ -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 index 0000000000..feed676f8a --- /dev/null +++ b/package/owfs/S60owfs @@ -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 diff --git a/package/owfs/owfs.mk b/package/owfs/owfs.mk index cd1c2dba6d..fccc2efa58 100644 --- a/package/owfs/owfs.mk +++ b/package/owfs/owfs.mk @@ -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