[Installit-dev] "package manager " becomes "InstallIt"

Jannis Pohlmann info at sten-net.de
Thu Sep 8 18:00:38 CEST 2005


Hey Benny,

Benedikt Meurer schrieb:
> Benedikt Meurer wrote:
> 
>>Jannis Pohlmann wrote:
>>
>>
>>>>Use kill($PID, 0) rather than /proc/$PID and you're ok. Trust me, it's 
>>>>really not worth the trouble with fcntl()/lockf() locking. And we're not 
>>>>developing a critical database, so if a user manages to start two 
>>>>instances of InstallIt, then he'll run into trouble and may remember to 
>>>>read the documentation when he uses a software next time. ;-)
>>>
>>>i tried this (it's in SVN, see Core/LockFile and i2t for the usage). It
>>>doesn't really work at all. What did you expect it to do?
>>
>>
>>Just checked it. Seems to work fine, except that you still use /proc
>>instead of kill().

yes, I commented out the kill() thing for one reason: It didn't do
anything useful. I asked myself what you could have meant by suggesting
kill() and came to the conclusion that your intend was to kill the
running instance before starting the new one, right? Well, I'd prefer
aborting the program if another instance already is running.

I couldn't find a platform-independent way for determining if a process
with a certain PID is running or not, this is why I used /proc. I'm
still not sure about this, perhaps fcntl/lockf is better anyway.

> 
> 
> And you shouldn't use negative exit codes, as on some platforms, that
> may not only affect the exit code, but also the additional exit status
> flags, which is certainly not what you want. Try to limit yourself to
> the exit codes from 0 to 126.

Yep, thought about that, too. I have to look into what the different
exit codes mean and use those which make sense.

- Jannis



More information about the Installit-dev mailing list