🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Jim Dutton Tue, 25 Mar 1997 00:00
Re: innd 1.5.1 - multiple innwatches?
#16286
Author: Jim Dutton
Date: Tue, 25 Mar 1997 00:00
26 lines
1714 bytes
Hi Gary, on Mar 24 you wrote:

> Yes.  thanks.  Still not sure how all those innwatch'es were left
> hanging around.  Perhsaps some config error that got fixed along
> the way ....

Multiple instantiations of INNWATCH usually imply that INND has died or been
shutdown. Since nothing stops INNWATCH in these situations, it keeps on
running. Then when INND is restarted, a NEW INNWATCH task is started (assuming
of course, that DOINNWATCH=TRUE).

At this point, NObody checks to see if there WAS an INNWATCH already running,
so now there is one MORE INNWATCH task.

For the moment, when you shutdown INND, you also need to kill the INNWATCH
task (if DOINNWATCH=TRUE). Assuming that there is only ONE INNWATCH running
at the time that INND is shutdown, then this will prevent multiple occurances
of INNWATCH tasks.

It should be fairly simple to test in RC.NEWS, or INNWATCH, whether an INNWATCH
task is already running, and if so, to NOT execute (or quit from) INNWATCH.
thus preventing multiple INNWATCH tasks. I think this would be best in RC.NEWS.


Re: innd 1.5.1 - multiple innwatches?
#16293
Author: Gary Funck
Date: Tue, 25 Mar 1997 00:00
13 lines
1009 bytes
Jim Dutton <jimd@slip106.termserv.siu.edu> wrote:
> It should be fairly simple to test in RC.NEWS, or INNWATCH, whether an INNWATCH
> task is already running, and if so, to NOT execute (or quit from) INNWATCH.
> thus preventing multiple INNWATCH tasks. I think this would be best in RC.NEWS.

Thanks. Yes, some sort of innwatch.lock might make sense.

-- 
--
| Gary Funck,  Intrepid Technology, gary@intrepid.com, (415) 964-8135

Re: innd 1.5.1 - multiple innwatches?
#16310
Author: Per Hedeland
Date: Tue, 25 Mar 1997 00:00
46 lines
2463 bytes
In article <242ade59.u9t27e.f0139@slip106.termserv.siu.edu>
jimd@slip106.termserv.siu.edu (Jim Dutton) writes:
>It should be fairly simple to test in RC.NEWS, or INNWATCH, whether an INNWATCH
>task is already running, and if so, to NOT execute (or quit from) INNWATCH.
>thus preventing multiple INNWATCH tasks.

Um, you mean something like this:

news@news 4> ps -e | grep innwatch
   283 ?       27:34 innwatch
news@news 5> innwatch
innwatch: [17828] locked by [283]
news@news 6> ps -e | grep innwatch
   283 ?       27:34 innwatch

Stock INN 1.5 innwatch - it's been in there since at least 1.4.

> I think this would be best in RC.NEWS.

Problem is, rc.news is supposed to be run at boot time, and thus
(rightfully) assumes that any lock files are leftovers from a possibly
unclean shutdown, and summarily removes them. Perhaps innwatch should
check that its lock file hasn't been stolen, and exit if it has - like
this maybe:

*** samples/innwatch.ctl	Thu Dec  5 17:34:30 1996
--- site/innwatch.ctl	Tue Mar 25 23:58:42 1997
***************
*** 18,23 ****
--- 18,27 ----
  ##  =()<!!! test -f @<_PATH_SERVERPID>@ && echo 0 || echo 1 ! eq ! 1 ! exit ! innd dead>()=
  !!! test -f /opt/news/innd/innd.pid && echo 0 || echo 1 ! eq ! 1 ! exit ! innd dead
  
+ ##  Also, just exit innwatch if a new one has started
+ ##  =()<!!! expr `cat @<_PATH_LOCKS>@/LOCK.${PROGNAME}` - $$ ! ne ! 0 ! exit ! innwatch replaced>()=
+ !!! expr `cat /opt/news/LOCK.${PROGNAME}` - $$ ! ne ! 0 ! exit ! innwatch replaced
+ 
  ##  Next test the load average.  Above first threshold pause, above higher
  ##  threshold throttle, below restart limit undo whatever was done.
  ##  =()<!load!load hiload! uptime | tr -d ,. | awk '{ print $(NF - 2) }' ! lt ! @<INNWATCH_LOLOAD>@ ! go ! loadav>()=

--Per Hedeland
per@erix.ericsson.se

Re: innd 1.5.1 - multiple innwatches?
#16329
Author: Mark A. Stevens
Date: Wed, 26 Mar 1997 00:00
106 lines
4699 bytes
In article <242ade59.u9t27e.f0139@slip106.termserv.siu.edu>,
Jim Dutton <jimd@slip106.termserv.siu.edu> wrote:
>Hi Gary, on Mar 24 you wrote:
>
>> Yes.  thanks.  Still not sure how all those innwatch'es were left
>> hanging around.  Perhsaps some config error that got fixed along
>> the way ....
>
>Multiple instantiations of INNWATCH usually imply that INND has died or been
>shutdown. Since nothing stops INNWATCH in these situations, it keeps on
>running. Then when INND is restarted, a NEW INNWATCH task is started (assuming
>of course, that DOINNWATCH=TRUE).
>
>At this point, NObody checks to see if there WAS an INNWATCH already running,
>so now there is one MORE INNWATCH task.
>
>For the moment, when you shutdown INND, you also need to kill the INNWATCH
>task (if DOINNWATCH=TRUE). Assuming that there is only ONE INNWATCH running
>at the time that INND is shutdown, then this will prevent multiple occurances
>of INNWATCH tasks.
>
>It should be fairly simple to test in RC.NEWS, or INNWATCH, whether an INNWATCH
>task is already running, and if so, to NOT execute (or quit from) INNWATCH.
>thus preventing multiple INNWATCH tasks. I think this would be best in RC.NEWS.

I realize that this is OS specific (Solaris 2.5.1), but it might help
anyway. I'm using it for my news 1.5.1 system I'm testing:

cat /etc/init.d/news
#! /bin/sh
##  $Revision: 1.12 $
##  News start/stop script.  Runs as "news" user.  Requires inndstart be
##  setuid root. See /etc/init.d/rc.news
##
##  Modified:   1997/03/12 MAS  Initial version.
##
##              yyyy/mm/dd iii  ...
##

inndpid=`/usr/bin/ps -e | /usr/bin/grep -v grep | /usr/bin/grep innd | /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`

case $1 in
'start')
        if [ "${pid}" = "" ]
        then
                if [ -x /etc/init.d/rc.news ]
                then
                        /opt/local/news/bin/rc.news >/dev/console 2>&1 &
                else
                        echo "unable to find /etc/init.d/rc.news, news not started."
                fi
                if [ -x /opt/local/news/bin/links ]
                then
                        echo "clearing nntplink datafiles"
                        /opt/local/news/bin/links clear
                else
                        echo "unable to find /opt/local/news/bin/links, nntplink datafiles not reset."
                fi
        fi
        ;;
'stop')
        if [ "${inndpid}" != "" ]
        then
                echo "stopping nntplink processes"
                if [ -x /opt/local/news/bin/links ]
                then
                        /opt/local/news/bin/links stop
                else
                        echo "unable to find /opt/local/news/bin/links, nntplink processes not stopped cleanly."
                fi
                if [ -x /opt/local/news/bin/ctlinnd ]
                then
                        echo "throttling news (innd)."
                        /opt/local/news/bin/ctlinnd throttle "news for shut down."
                        echo "shutdown news (innd)."
                        /opt/local/news/bin/ctlinnd shutdown "news."
                else
                        echo "unable to find /opt/local/news/bin/ctlinnd, news not shut down."
                fi
        else
                echo "news (innd) not running."
        fi

        innwatchpid=`/usr/bin/ps -e | /usr/bin/grep -v grep | /usr/bin/grep innwatch | /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`

        if [ "${innwatchpid}" != "" ]
        then
                echo "shutdown innwatch"
                /usr/bin/kill ${innwatchpid}
        else
                echo "innwatch not running."
        fi
        ;;
*)
        echo "usage: /etc/init.d/news {start|stop}"
        ;;
esac

-- 
Mark A. Stevens                      Phone:    708-235-2204
Systems Programmer/Administrator     Internet: xmas@uxa.ecn.bgu.edu
Educational Computing Network        WWW:      http://www.ECNet.Net/users/xmas/
Governors State University           VMSHARE:  ECE/MARK

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads