This is the mail archive of the
mailing list for the Cygwin project.
Cron service spawns windowless child, how to create a window?
- From: BÅaÅej <blazhito at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 9 Jan 2011 03:09:42 +0100
- Subject: Cron service spawns windowless child, how to create a window?
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
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" 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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple