i found this script (bash) from you deb package, is that right? just
start-stop-daemon command do the 'auto-restart' feature?
thanks
#!/bin/sh
### BEGIN INIT INFO
# Provides: owserver
# 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
CONFFILE=/etc/owfs.conf
DESC="1-Wire TCP Server"
NAME="owserver"
DAEMON=/usr/bin/$NAME
PIDDIR=/var/run/owfs
PIDFILE=$PIDDIR/$NAME.pid
# 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 --exec $DAEMON -- -c
$CONFFILE \
--pid-file $PIDFILE
# ensure the daemon has been started
sleep 1
pidofproc -p $PIDFILE $DAEMON >/dev/null
}
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
2011/8/8 Mark Richards <[email protected]>
> On 8/8/2011 06:29, Vincent Danjean wrote:
>
> Look at my Debian package (see my signature). You can do
> /etc/init.d/owserver stop or /etc/init.d/owserver restart depending if you
> want to stop or restart (ie kill and start) owserver. About the packaging: I
> plan to update my packages to the latest release and then upload them
> officially to Debian (so it will also be in Ubuntu) as soon as I come back
> from holidays. If you have any comments about the packaging, do not hesitate
> to answer to this message. Regards, Vincent
>
>
> Vincent,
>
> As you have Debian packages for owserver, are there any code or build
> modifications you had to make? It seems my owserver exits without a trace
> when processor time is scarce, and it is under Debian.
>
> /mark
>
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>
--
Roberto Spadim
Spadim Technology / SPAEmpresarial
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers