[maemo-developers] Check if application is run
From: Michael Stepanov michael at stepanoff.orgDate: Thu Nov 15 11:07:58 EET 2007
- Previous message: Check if application is run
- Next message: Check if application is run
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks for your suggestions. IMHO the most appropriate way (but probably not easiest) is to use DBUS functionality as Mika Yrjölä described. What do you think? On 11/15/07, Eero Tamminen <eero.tamminen at nokia.com> wrote: > > Hi, > > ext Aleksandr Koltsoff wrote: > > Eero Tamminen wrote: > >> ext Aleksandr Koltsoff wrote: > >>> I think in your case it would be sufficient to do something like this: > >>> while true; do > >>> ./run-your-application params > >>> sleep 2 > >>> done > >>> > >>> Or in C: > >>> > >>> while(1) { > >>> system("./run-your-application params"); > >>> sleep(2); > >>> } > >> That would shorten the battery life. If one really needs/wants > >> to kludge things with polling, the interval should be several > >> times larger. > > > > When the application is running, both methods wait for the process to > > terminate, i.e., no polling. man 3 system. The idea originally was that > > should the application terminate, it will be restarted after a while. > > Sorry, I didn't read your mail properly (need to get new glasses > one of these days...), I just saw the "sleep 2". > > > > If the application is completely broken, and will fail to start in any > > case, then this would amount to polling, and would shorten battery life. > > This would happen also if the process daemonizes itself. > > > > My original post did suggest handling exit codes of the child properly, > > but I guess that was lost somewhere in the process.. > > > >>> Linux (kernel) does not have a non-polling mechanism to track > >>> PID-existance for non-related processes. > >> It has, you just need to be the process parent. :-) > > > > Note the "non-related" part :-). Parent <-> child = related processes. > > > - Eero > _______________________________________________ > maemo-developers mailing list > maemo-developers at maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > -- Cheers, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20071115/417fe67a/attachment.htm
- Previous message: Check if application is run
- Next message: Check if application is run
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]