kumquat-buildroot/package/owfs/S25owserver
Arnout Vandecappelle ac940e023d owfs: add sysv init scripts
owserver is started unconditionally, but it needs the device(s) to
be specified at startup. Therefore a check for non-empty OWSERVER_ARGS
is added to the owserver start script.

owfs is started only if is built. It will connect to the owserver.
It will try to load the fuse module; if fuse is built-in or already
loaded, modprobe -q will fail silently. The filesystem will be mounted
on /dev/1wire, because it represents the 1-wire slave devices; also,
the bundled Debian init scripts mount it there. We have to create that
directory in the init script in case of devtmpfs, and we have to create
it in the rootfs for static /dev; for simplicity, just do both.

Users who want a setup without owserver need to remove the owserver
init script post-build and need to give appropriate defaults to owfs.

[Peter: fix mountpoint variable typo in S30owfs]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-03-27 00:53:16 +01:00

32 lines
634 B
Plaintext
Executable File

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