Summary - How to tell if a process is active
Frank I. Reiter
frank at rsoft.bc.ca
Thu Jun 22 23:45:45 AEST 1989
In article <763 at ctisbv.UUCP> pim at ctisbv.UUCP (Pim Zandbergen) writes:
>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,
>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.
Have your startup code do something like "touch /etc/startup-file" .
Now your applications can compare the modification date on this
file to the modification date on your lock files.
A better alternative (IMHO) is to have a cleanup script in your startup
code which deletes any extraneous lock files. This eliminates the need
to check dates at run time.
--
_____________________________________________________________________________
Frank I. Reiter UUCP: {uunet,ubc-cs}!van-bc!rsoft!frank
Reiter Software Inc. frank at rsoft.bc.ca, a2 at mindlink.UUCP
Langley, British Columbia BBS: Mind Link @ (604)533-2312, login as Guest
More information about the Comp.unix.questions
mailing list