interesting - I wasnt aware of that, it would be very elegant and faster than a 
bash loop with a timer

unfortunately this means an extra package dependency, inotify-tools:

  $ apt-cache search inotifywait
  inotify-tools - command-line programs providing a simple interface to inotify

I'm unsure whether it's wise to inject a new dependency for such a fundamental 
script - if the consensus is a loud "yes", ok - otherwise, rather not. I can 
already hear "there, Haberler broke LinuxCNC AGAIN!" ;)

- Michael

Am 26.08.2012 um 08:24 schrieb Gene Heskett:

> On Sunday 26 August 2012 02:06:08 Michael Haberler did opine:
> 
>> Am 26.08.2012 um 01:11 schrieb Chris Morley:
>>>> 3. ALL guis, not just Axis, need to eventually learn how to start a
>>>> POSTGUI_HALFILE if there is any chance itself or a subprocess
>>>> creates additional HAL objects. To do so, they need to understand
>>>> that they are the primary UI component. This suggests a per-ui
>>>> command line flag like '--primary-ui'.
>>> 
>>> AXIS, TOUCHY and The future Gscreen all understand POST_GUI.
>>> TOUCHY requires a touchy.hal file though.
>>> It would be nice if linuxcncTK could be retrofitted with POSTGUI and
>>> at least PYVCP panels. but TCL is not my bag....
>> 
>> I think by now the whole POSTGUI_HALFILE thing was a kludge. The
>> linuxcnc.in assumption is: shutdown happens when the UI program exits,
>> so just block on the UI program, and run cleanup thereafter.
>> 
>> It would be much easier and uniform if:
>> 1. linuxcnc.in just starts the UI in the background and records its pid
>> 2. linuxcnc.in waits for the UI to be fully set up (all HAL comps/pins
>> created and ready) 3. linuxcnc.in runs any POSTGUI type jobs.
>> 4. when done, it explicitly waits for the UI pid.
>> 
>> 1,3,4: easy
>> 2: I'm taking suggestions - one cant tell in advance which halcomps are
>> set up behind the UI, so you cant test for them being ready easily;
>> also halcmd is less than helpful wrt exit status: say 'halcmd show comp
>> axis' always reports exit status 0 even if comp axis doesnt exist.
>> 
>> Maybe somebody has a simple idea in his bag of shell tricks how a
>> process can notify the parent shell that some step is complete.
>> 
>> - Michael
> 
> I have been using inotifywait to detect the closing of a mail file in 
> /var/spool/mail, which then sends kmail a "go get the local mail" message 
> over the dbus for about 3 years now.  inotifywait will return the name of 
> the file when it exits.  IIRC you can watch a dir as I do, or you can watch 
> for a specific filename, meaning you could launch more than one copy of it, 
> getting a response back only when the named file has been touched or 
> created.  Make touching/creating that file in /tmp the last thing the 
> accessory does as it initializes.
> 
> In the parent, keep an array of pid's  obtained when the inotifywait was 
> launched, and issue kill's for those pids to clean up at exit time.
> 
> For email use, I exit inotifywait, which returns the name of the mailfile 
> as I use several procmail recipes to control the mailfile name, and when it 
> has returned the name, I immediately relaunch inotifywait to catch the next 
> email, and send the msg to kmail.
> 
> There may be other ways to do it, but it seems to me it fits this job 
> description well.  It is part of the inotify_tools pkg.
> 
>>> One thing that happens is if you try to load two guis in the same
>>> config (not often to happen, but sometimes when testing) is that both
>>> guis try to load the POSTGUI file and of course the last one fails
>>> due to the pins/signals already being present. Not sure if that is a
>>> real deal breaker...
>>> 
>>> It would be a good idea is we added a section in the developers manual
>>> about the common requirements of a 'full featured' gui screen eg
>>> reparenting, POSTGUI etc. easier to follow the standard then fix the
>>> code after the fact...
>>> 
>>> my 2 cents :)
>>> Chris M
>>> 
>>> ----------------------------------------------------------------------
>>> -------- Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond.
>>> Discussions will include endpoint security, mobile security and the
>>> latest in malware threats.
>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Emc-developers mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>> 
>> ------------------------------------------------------------------------
>> ------ Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond.
>> Discussions will include endpoint security, mobile security and the
>> latest in malware threats.
>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Emc-developers mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
> 
> 
> Cheers, Gene
> -- 
> "There are four boxes to be used in defense of liberty:
> soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
> Drew's Law of Highway Biology:
>       The first bug to hit a clean windshield lands directly in front
>       of your eyes.
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to