diff --git a/Makefile b/Makefile index 58d4982..487e317 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,8 @@ uninstall: /bin/rm -f /var/log/g2_link.log ######### dvap_rptr ######### /usr/sbin/service dvap_rptr stop - /bin/rm -f $(BINDIR)/dvap_rptr + /bin/rm -f /etc/init.d/dvap_rptr /usr/sbin/update-rc.d dvap_rptr remove + /bin/rm -f $(BINDIR)/dvap_rptr + /bin/rm -f $(BINDIR)/dvap_rptr.sh /bin/rm -r $(CFGDIR)/dvap_rptr.cfg diff --git a/dvap_rptr.sh b/dvap_rptr.sh new file mode 100755 index 0000000..ddd2020 --- /dev/null +++ b/dvap_rptr.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# +# Copyright (C) 2010 by Scott Lawson KI4LKF +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + +while [ 1 ]; +do + /usr/local/bin/dvap_rptr /usr/local/etc/dvap_rptr.cfg > /var/log/dvap_rptr.log 2>&1 + sleep 10 +done + diff --git a/service.dvap_rptr b/service.dvap_rptr index 6eba51e..a1b83b6 100755 --- a/service.dvap_rptr +++ b/service.dvap_rptr @@ -13,26 +13,29 @@ . /lib/lsb/init-functions -DVAP_RPTR_EXE=/usr/local/bin/dvap_rptr -DVAP_RPTR_CFG=/usr/local/etc/dvap_rptr.cfg -DVAP_RPTR_LOG=/var/log/dvap_rptr.log +DVAP_RPTR_SH=/usr/local/bin/dvap_rptr.sh +DVAP_RPTR_BIN=/usr/local/bin/dvap_rptr +DVAP_RPTR_PIDFILE=/usr/local/bin/dvap_rptr.sh_pidfile start() { - status_of_proc dvap_rptr >/dev/null + status_of_proc $DVAP_RPTR_SH >/dev/null RETVAL=$? if [ "$RETVAL" = "0" ] ; then - echo "dvap_rptr already running" + echo "$DVAP_RPTR_SH already running" else - echo -n "Starting dvap_rptr" - start-stop-daemon --exec $DVAP_RPTR_EXE -S $DVAP_RPTR_CFG > $DVAP_RPTR_LOG 2>&1 & + /bin/rm -rf $DVAP_RPTR_PIDFILE + echo -n "Starting $DVAP_RPTR_SH:" + start-stop-daemon --make-pidfile --pidfile $DVAP_RPTR_PIDFILE --exec $DVAP_RPTR_SH -S & log_end_msg $? fi } stop() { - start-stop-daemon --exec $DVAP_RPTR_EXE --retry 5 -K + start-stop-daemon --pidfile $DVAP_RPTR_PIDFILE --retry 5 -K + start-stop-daemon --exec $DVAP_RPTR_BIN --retry 5 -K + /bin/rm -rf $DVAP_RPTR_PIDFILE } case "$1" in @@ -47,8 +50,11 @@ restart) start ;; status) - echo -n "dvap_rptr " - status_of_proc dvap_rptr + echo -n "$DVAP_RPTR_SH " + status_of_proc $DVAP_RPTR_SH + + echo -n "$DVAP_RPTR_BIN " + status_of_proc $DVAP_RPTR_BIN ;; *) log_action_msg "Usage: /etc/init.d/dvap_rptr {start|stop|restart|status}"