Path: utzoo!attcan!uunet!comtst!mdv From: mdv@comtst.UUCP (Mike Verstegen) Newsgroups: comp.unix.questions Subject: Re: uugetty & lock files Message-ID: <144@comtst.UUCP> Date: 12 Sep 90 13:28:06 GMT References: <384@fe2o3.UUCP> <9422@uudell.dell.com> Reply-To: mdv@comtst.UUCP (Mike Verstegen) Organization: Domain Systems, Inc., West Palm Beach, FL Lines: 47 In article <9422@uudell.dell.com> rjd@ninja.dell.com writes: [ stuff deleted...] > > Yeah, easy.... First make sure the uugetty timeout is enabled, then, in >your progam, simply get the process ID number FROM the lockfile and check to >see if the process exists. If the process does not exist, then remove the >lockfile, since it is invalid. > >An easy way to do this is > >if ps -p `cat -s $LCKFILE` > /dev/null >then > : # don't remove lockfile > else > rm $LCKFILE >fi On our system, /usr/spool/locks is owned by uucp, group uucp, with drwxr-xr-x permissions. (As best I can tell, this is standard for AT&T 3B2 V.3.1 and ISC 2.0.2) To me, it appears that this script will only work for scripts run as uucp or the permissions on /usr/spool/locks have been changed. We have a software application that needs direct access to modems and does not use cu or uucp. We tried dial(3), but it's broken (still makes reference to L.sys for a HDB uucp environment -- AT&T Hotline says it's not going to be fixed). Our solution was to write a small program that is suid to uucp and does nothing but create (with the correct format) and remove lock files. We had to take this approach because our original solution (chmod o+w /usr/spool/locks raised the ire of some administrators). I'd like to know what the permissions are on other systems (both the installation permssions and what most administrators change them to) and if anyone else has a better solution to the problem. > [ shell script deleted ] > >Good luck, > >Randy Davis UUCP: rjd@ninja.dell.com > -- Mike Verstegen Domain Systems, Inc Voice +1 407 686-7911 ..!uunet!comtst!mdv 5840 Corporate Way #100 Fax +1 407 478-2542 mdv@domain.com West Palm Beach, FL 33407