Path: utzoo!utgpu!water!watmath!clyde!rutgers!uwvax!oddjob!gargoyle!ihnp4!occrsh!occrsh.ATT.COM!rjd From: rjd@occrsh.ATT.COM Newsgroups: comp.sys.att Subject: Re: HDB, gnuemacs, & GL Message-ID: <144800020@occrsh.ATT.COM> Date: 26 Jan 88 16:46:00 GMT References: <2272@gryphon.CTS.COM> Lines: 72 Nf-ID: #R:gryphon.CTS.COM:-227200:occrsh.ATT.COM:144800020:000:3023 Nf-From: occrsh.ATT.COM!rjd Jan 26 10:46:00 1988 >I recently installed HoneyDanBer UUCP, and wonder why I put it off so >long. The only problem is that HDB deals with lock files differently, >and if I am using kermit or async_main when uucp decides it wants to >use the phone, I'm out of luck. uucp just grabs without asking. >Perhaps something could be done in uudemon.hour to modify the lock >files before uusched is called (though this wouldn't help if someone >issued a uucp command and didn't tell it to queue). Any suggestions? >I tried a few things, but the debug file for uucp keeps showing, "ok >to remove lock file," as I shout, "No! Don't!" Leave the uucp commands alone..... You just need to create a file by the name LCK.. containing the process ID number of the active process that is using the port. Uucp checks for this LCK.. file *AND* checks to see if the process number contained in the file is still active before opening the port. If the process number in the file is not active or there is no process number in the file (but nobody would do that, would they? :-) ), it *IS* "ok to remove the lck file". I wrote a shell script to handle the generation of the lock files which might explain it better. This shell script works both ways: it will not let your process use the port if uucp is using it, and if uucp is not using it, it will generate the proper lock file so uucp will not "grab" it in the middle of your session. Be aware that the lock files are NOT removed religiously once the using process terminates. This is not a bad thing, as you should always check for the existance of the process before assuming that the port is actually in use, as the existance of the lock file is not the final word. Here is the pertainent fragment: -------------------------------------------------------------------------------- # "DK" is the device name I am needing to use, you will need to change it below # to the desired device name in your Devices file. - RJD #EXEC= #NUM= BAD=YES for PORT in `/bin/grep '^DK ' /usr/lib/uucp/Devices | /usr/bin/cut -c4-9` do LCKFILE=/usr/spool/locks/LCK..$PORT if [ -s $LCKFILE ] then /bin/ps -p `/bin/cat $LCKFILE` > /dev/null if [ $? -eq 1 ] then BAD=NO break fi else BAD=NO break fi done if [ "$BAD" = "NO" ] then /bin/echo $$ > $LCKFILE /bin/chgrp uucp $LCKFILE /bin/chmod 444 $LCKFILE /bin/chown uucp $LCKFILE $EXEC -l/dev/$PORT -s # Execute the program that uses the port if [ $? -ne 0 ] then BAD=YES fi /bin/rm -f $LCKFILE else /bin/echo "${0}: no devices available, count $NUM" fi -------------------------------------------------------------------------------- Randy Davis UUCP: ...(ihnp4!)3b2fst!randy 3B2 System Test Engineering ...(ihnp4!)occrsh!rjd AT&T Network Systems, Oklahoma City Works All opinions and/or advice stated above are MY OWN, not those of AT&T.