Article View: news.software.nntp
Article #16310Re: innd 1.5.1 - multiple innwatches?
From: Per Hedeland
Date: Tue, 25 Mar 1997 00:00
Date: Tue, 25 Mar 1997 00:00
46 lines
2463 bytes
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
Technical Details
Message-ID:
<5h9mo4$jer$1@news.du.etx.ericsson.se>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<242ade59.u9t27e.f0139@slip106.termserv.siu.edu>Show Full Headers
Complete Article Headers
Message-ID: <5h9mo4$jer$1@news.du.etx.ericsson.se> Subject: Re: innd 1.5.1 - multiple innwatches? Date: Tue, 25 Mar 1997 00:00:00 +0000 From: per@erix.ericsson.se (Per Hedeland) References: <242ade59.u9t27e.f0139@slip106.termserv.siu.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 228339738 Organization: Ericsson Telecom, Stockholm, Sweden Newsgroups: news.software.nntp NNTP-Posting-User: per