[news.sysadmin] Need help with rn/bnews on Apollos

kcantrel@digi.UUCP (Keith Cantrell) (08/16/89)

I have run into a problem with running rn when rnews or rn is already running
on a different machine.  The problem is the first one will open the file
"/usr/lib/news/active" for reading and therefore the Apollo operating system
will lock it.  After this has happens, I am unable to get a second rn or rnews
to run on a different machine, the fopen complains "Text file busy".  This
problem does not exist if both programs are running on the same machine.

This was a major problem when I started up rn on my machine and rnews was
started up on a different machine and started loosing news since it could not
open the active file :-(

Has anybody else since this problem?  It is easy to reproduce, just write a
small program to open a file and executed it on two different machines and you
will see the problem.

Now for the particulars:
  Machines: DN3500
  Operating system: BSD4.3-DOMAIN/OS
  News version: "B 2.11 1/24/89"

I someone could please help me with this I would greatly appreciate it,

Keith

-----------------------------------------------------------------------
Keith Cantrell                    Phones:  hm: 214-492-1088
                                           wk: 214-519-2399 @ DSC 
USMAIL:                          EMAIL:
2100 Sonata Ln                   cantrell@attctc.DALLAS.TX.US
Carrollton TX 75007                           or
                                   ...!attctc!digi!kcantrel
-----------------------------------------------------------------------

chen@spanky.sps.mot.com (Jinfu Chen) (08/17/89)

In article <203@digi.UUCP> kcantrel@digi.UUCP (Keith Cantrell) writes:
>I have run into a problem with running rn when rnews or rn is already running
>on a different machine.  The problem is the first one will open the file
>"/usr/lib/news/active" for reading and therefore the Apollo operating system
>will lock it.  After this has happens, I am unable to get a second rn or rnews
>to run on a different machine, the fopen complains "Text file busy".  This
>problem does not exist if both programs are running on the same machine.
>
>This was a major problem when I started up rn on my machine and rnews was
>started up on a different machine and started loosing news since it could not
>open the active file :-(
>


The version of rn in ADUS 1989 library already fixed this. It makes a private
copy of active upon invoking. The drawback is that you will need to re-enter
rn to see new articles being posted during your previous session of rn, this is
really not a problem at all.


Jinfu Chen                  (602)898-5338      |       Disclaimer:
Motorola, Inc.  Digital Div., Mesa, AZ         | My employer doesn't pay
..{somewhere}!uunet!dover!digital!chen        | me to express opinions.
----------

peter@ficc.uu.net (Peter da Silva) (08/17/89)

You have the same problem if the news node is inaccessable for some reason.

The best solution I've found to running rnews over a network is to replace
/usr/bin/rnews with a shell script that remotely execs rnews on the machine
the news system is on, with a bit of extra sugar to save the news somewhere
handy if the remote node is really dead. In our case that script is:

:
cat >/tmp/rnews$$
if rexec //xds13/usr/bin/rnews $* < /tmp/rnews$$
then
  rm /tmp/rnews$$
else
  echo "`date` * rnews - can't access xds13" >> /usr/spool/uucp/POLLOG
  mv /tmp/rnews$$ /usr2/saved.news/`date +%y%m%d.%H%M%S`
fi

Then I run something in the crontab *on the news machine* to snarf the
files in //ficc/usr2/saved.news. A similar technique can probably be used
on your Apollo network.
-- 
Peter da Silva, *NIX support guy @ Ferranti International Controls Corporation.
Biz: peter@ficc.uu.net, +1 713 274 5180. Fun: peter@sugar.hackercorp.com. `-_-'
"Optimization is not some mystical state of grace, it is an intricate act   U
   of human labor which carries real costs and real risks." -- Tom Neff

dclemans@mentor.com (Dave Clemans @ APD x1292) (08/17/89)

From article <203@digi.UUCP>, by kcantrel@digi.UUCP (Keith Cantrell):
> I have run into a problem with running rn when rnews or rn is already running
> on a different machine.  The problem is the first one will open the file
> "/usr/lib/news/active" for reading and therefore the Apollo operating system
> will lock it.  After this has happens, I am unable to get a second rn or rnews
> to run on a different machine, the fopen complains "Text file busy".  This
> problem does not exist if both programs are running on the same machine.
> 
> This was a major problem when I started up rn on my machine and rnews was
> started up on a different machine and started loosing news since it could not
> open the active file :-(
> 

What I've done is to modify rn, vn, etc. to access an "active.copy" file
instead of the "active" file.  A cron job runs every 15 minutes to copy
"active" to "active.copy".  Thus all the news reader programs, and their
read locks don't interfere with news reception.

For rn specifically, I modified it to not always keep the active file open
(otherwise the cron job that copies "active" to "active.copy" would have
problems).

dgc

kcantrel@digi.UUCP (Keith Cantrell) (08/18/89)

In article <1690@dover.sps.mot.com> chen@spanky.sps.mot.com (Jinfu Chen) writes:

Jinfu> In article <203@digi.UUCP> kcantrel@digi.UUCP (Keith Cantrell) writes:
>I have run into a problem with running rn when rnews or rn is already running
>on a different machine.  The problem is the first one will open the file
>"/usr/lib/news/active" for reading and therefore the Apollo operating system
>will lock it.  After this has happens, I am unable to get a second rn or rnews
>to run on a different machine, the fopen complains "Text file busy".  This
>problem does not exist if both programs are running on the same machine.
>
>This was a major problem when I started up rn on my machine and rnews was
>started up on a different machine and started loosing news since it could not
>open the active file :-(
>
Jinfu> 
Jinfu> The version of rn in ADUS 1989 library already fixed this. It makes a private
Jinfu> copy of active upon invoking. The drawback is that you will need to re-enter
Jinfu> rn to see new articles being posted during your previous session of rn, this is
Jinfu> really not a problem at all.
Jinfu> 

Yea, this is the klugdy work around that I tried, but I found that you can not
even create a private copy if the file is locked!  In other words, I was unable
to copy the file if rnews was running.  Also, I am dead set against copying
once a day or any such nonsense like that.  I have been tempted to just
"/com/ulkob -f" the file, but I am not sure how that will screw things up.

So, does anybody else have any ideas?????

Keith

-----------------------------------------------------------------------
Keith Cantrell                    Phones:  hm: 214-492-1088
Apollo Computer                            wk: 214-519-2399 @ DSC 
A Subsidiary of Hewlett-Packard
USMAIL:                          EMAIL:
2100 Sonata Ln                   cantrell@attctc.DALLAS.TX.US
Carrollton TX 75007                           or
                                   ...!attctc!digi!kcantrel
-----------------------------------------------------------------------