Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!alberta!ubc-cs!van-bc!rsoft!frank From: frank@rsoft.bc.ca (Frank I. Reiter) Newsgroups: comp.unix.questions Subject: Re: Summary - How to tell if a process is active Keywords: process kill ps Message-ID: <57@rsoft.bc.ca> Date: 22 Jun 89 13:45:45 GMT References: <2848@infocenter.UUCP> <763@ctisbv.UUCP> Reply-To: frank@rsoft.UUCP (Frank I. Reiter) Organization: Reiter Software Inc., British Columbia Lines: 24 In article <763@ctisbv.UUCP> pim@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@rsoft.bc.ca, a2@mindlink.UUCP Langley, British Columbia BBS: Mind Link @ (604)533-2312, login as Guest