/opt/owfs/bin/owfs -u --allow_other /mnt/1wire
Har ett startscript som fungerade förut, men nu efter ominstallation så fallerar det. Jag antar att det har att göra med att raspian har övergått till upstart i Debian Jessie?
Har någon ett fungerande startskript för owfs med upstart? Följande fungerar inte för mig.
Kod: Markera allt
#!/bin/sh
### BEGIN INIT INFO
# Provides: owfs
# Required-Start: $remote_fs $syslog $network $named
# Required-Stop: $remote_fs $syslog $network $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: 1-wire TCP server
# Description: Start and stop a TCP server for 1-wire control.
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="1-Wire Files system"
NAME="owfs"
DAEMON=/opt/owfs/bin/$NAME
PIDDIR="/var/run/owfs"
PIDFILE=$PIDDIR/$NAME.pid
ARGS=" -u --allow_other /mnt/1wire"
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
d_start()
{
[ -d $PIDDIR ] || {
mkdir -m 0775 -p $PIDDIR
chown root:root $PIDDIR >/dev/null 2>&1
}
start-stop-daemon --start --quiet --oknodo --make-pidfile --pidfile $PIDFILE --exec $DAEMON --$ARGS
}
d_stop() {
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
sleep 1
if [ -f $PIDFILE ] && ! ps h `cat $PIDFILE` > /dev/null
then
# Stale PID file (owserver was successfilly stoped),
#remove it
rm -f $PIDFILE
fi
}
d_status() {
pidofproc -p $PIDFILE $DAEMON > /dev/null
}
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
d_start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
d_stop
log_end_msg $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
d_status && d_stop
d_start
log_end_msg $?
;;
status)
d_status
if [ $? -eq 0 ];then
log_success_msg "$NAME is running"
else
log_failure_msg "$NAME is not running"
fi
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
Kod: Markera allt
pi@domoticzpi:~$ sudo service owfs start
Job for owfs.service failed. See 'systemctl status owfs.service' and 'journalctl -xn' for details.
pi@domoticzpi:~$ systemctl status owfs.service
● owfs.service - 1-wire filesystem FUSE mount
Loaded: loaded (/lib/systemd/system/owfs.service; disabled)
Active: failed (Result: exit-code) since Sat 2016-06-25 23:40:04 CEST; 11s ago
Docs: man:owfs(1)
Process: 1341 ExecStart=/opt/owfs/bin/owfs --server=127.0.0.1 --allow_other %t/owfs (code=exited, status=1/FAILURE)