This is the mail archive of the
mailing list for the Cygwin project.
Re: Cron service spawns windowless child, how to create a window?
2011/1/9 BÅaÅej :
> Let me first explain the setup a little. I have a Windows PE app
> (written in Delphi) that I want to keep running at all times and also
> bullet-proof it against http connection timeouts, file reading errors
> etc. It logs its actions periodically to a logfile so based on whether
> this file was recently changed I can tell if the app is operational (ie.
> it could be up and running, but not doing its job as intended).
> Next up, I have cron running as service, I set up a following cronjob:
> Â* * * * * ~/md5compare.sh
You are running into a limiation of the System user, even with desktop
interaction enabled not all GUI controls will work due to windows security,
and it's no good idea to use GUI's as service anyway.
Same nightmare as running a X server as root.
I would propose
1. to use the standard windows mechanisms instead. at /interactive ...
or 2. if it's possible for you, run cron as user, not as System.
Application wise people are usually just stat the size of a growing logfile,
not md5, and act accordingly.
Testing http timeouts or locks, I usually test with a periodic
httpping, not with a logfile.
If the ping to a reliable server fails something is going on. (Modem,
router, windows, ...)
> This script creates a MD5 checksum of the logfile and compares it with
> the one it created before. Source is here:
> The important part that I changed is this:
> Âif [ "$OLDMD5PRINT" = "$MD5PRINT" ]
> Âpkill -9 appname
> Â~/linktoexe &
> ("linktoexe" is a symbolic link to the .exe file located elsewhere in
> the Windows filesystem.)
> This setup works fine as far as its desired functionality goes ie. once
> the app is closed, abnormally stops its usual work, hangs on http
> request (etc), it takes at most 2 minutes to restart and restore its
> However, there is a problem: the Windows application is started by the
> sh interpreter (which was run by the cron service), but in a windowless
> state. I figured this was a cron service problem so I allowed for it to
> communicate with the desktop (which is less than optimal) but that did
> not help - instead, the GUI is broken. It seems no controls originating
> from the app can be drawn in the window frame or tray icon (same with
> context menus). The app responds to all user input, as I can see in the
> logfile but doesn't give any visual feedback.
> I tried hard to find an answer to this problem but I'm not really
> Linux-savvy and my usual Google skills seem to have failed me.
> Therefore my question is, is it possible and if so, how, to have the
> Windows PE app run as intended, in a desktop window with its GUI fully
> Problem reports: Â Â Â http://cygwin.com/problems.html
> FAQ: Â Â Â Â Â Â Â Â Â http://cygwin.com/faq/
> Documentation: Â Â Â Â http://cygwin.com/docs.html
> Unsubscribe info: Â Â Âhttp://cygwin.com/ml/#unsubscribe-simple
http://phpwiki.org/Â; Â Â Â ÂÂ http://murbreak.at/
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple