Re: [iPAQ] run-once ?

From: <pwborders.a.t.home.com>
Date: Mon Dec 31 2001 - 18:55:17 EST

Take a look at

http://linux.companionlink.com/cpsdownloads.htm

specifically the xsingleinstance program.

Pete Borders

On 31 Dec 2001, at 11:56, Tom wrote:

> On Mon, Dec 31, 2001 at 12:26:16AM +0000, Alan Cox wrote:
> > Something as simple as doing
> >
> > open lockfile
> > flock lockfile
> > exec binary
> >
> > will work. The binary will close the lock file when it
> > exits,breaking the lock. flock allows you to test a lock so you can
> > avoid blocking taking it
>
> that part is easy. I would, however, prefer to look into /proc or ps
> instead, just to make sure that a) I catch cases where the binary is
> started by other means, too and b) to avoid all sorts of trouble with
> lockfiles not being removed correctly (kill -9).
>
> the more interesting part is dealing with the "it already runs" case.
> cycling it to the foreground would probably be the best answer. that
> is windowmanager territory, something I haven't coded in so far.
>
>
> --
> http://web.lemuria.org/pubkey.html
> pub 1024D/D88D35A6 2001-11-14 Tom Vogt <tom@lemuria.org>
> Key fingerprint = 276B B7BB E4D8 FCCE DB8F F965 310B 811A D88D
> 35A6
> _______________________________________________
> iPAQ mailing list
> iPAQ@handhelds.org
> http://handhelds.org/mailman/listinfo/ipaq
> irc://irc.openprojects.net #ipaq
Received on Mon Dec 31 15:48:41 2001

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:41:27 EDT