Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.unix.questions Subject: Re: Summary - How to tell if a process is active Message-ID: <589@lakart.UUCP> Date: 23 Jun 89 13:48:15 GMT References: <763@ctisbv.UUCP> Organization: Lakart Corporation, Newton, MA Lines: 32 From article <763@ctisbv.UUCP>, by pim@ctisbv.UUCP (Pim Zandbergen): ] But as our application is mainly turnkey based, I have seen more ] then once that checking the pid only is not enough. Our customers ] turn on the machine, and go right away into the application. ] At that time a resource is being claimed. Then there is a system crash, ] the system is rebooted, and the application is restarteds, ] AND IS RUNNING WITH THE EXACT SAME PID! Hence, when it finds ] the lockfile, it checks for its pid and finds out it exists, ] and fails to claim the resource. The second time the application ] is started it will continue without failure. ] ] So I am looking for some way to put some extra information into ] the lockfile to find out if the machine has been rebooted ] since the resource claim. What is the most obvious and portable ] way to do this? Why not just give the lock files a generic name - /usr/spool/lock/XXresource or somesuch. Now do a: rm -f /usr/spool/lock/XX* in your /etc/rc (or /etc/rc.local if you have a civilized system) and you're all set: the lockfiles all vanish every time the system comes up. -- dg@lakart.UUCP - David Goodenough +---+ IHS | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@xait.xerox.com +---+