running interactive process on xp through cron not working

James Johnston JamesJ@motionview3d.com
Fri Aug 10 14:49:00 GMT 2012


> -----Original Message-----
> Sent: Friday, August 10, 2012 04:13
> Subject: Re: running interactive process on xp through cron not working
> 
> > Any ideas on how to make cron work to allow me run programs
> > interactively like notepad?
> 
> To be honest, making this work is tenuous at best.  MS doesn't want things
to
> work this way anymore because it's viewed as a security hole (arguably a
> valid point).  If you're running XP, then you have a better chance but, as
> you've noticed, it's not guaranteed either.  And it will most certainly
stop
> working if you move to a later O/S version.  I know.  Not what you wanted
to
> hear and some additional research and perseverance on your part may
> unearth a solution that works for you.  But there's no magic bullet here,
> sorry.

It's even more complicated than just security.  For example, if multiple
users are logged into the computer, such as with Fast User Switching, or a
Terminal Services environment - which desktop would you start the Notepad
in?  What if no user is logged in?

Rather than trying to use cron, why not use the built-in task scheduler in
Windows?  It's what it's there for.  A quick test confirms that I can start
an interactive process like Notepad on a schedule.  I'm not sure how the XP
scheduler works, but on Win7, I can configure the task to run under my user
account, and then specify "run only when user is logged on".  That seems to
launch Notepad interactively on my desktop.  Most likely the service is
communicating with an interactive client on my desktop to launch this.  If
you specify "run whenever user is logged on or not", then the task scheduler
service will not do this, and just launch Notepad directly from the
non-interactive task scheduler service.  A quick test shows that when this
option is chosen, a Notepad.exe instance is started, but shows no user
interface and has no GDI/user handles.  Perhaps there are similar options on
XP.

I would imagine that cron would need some Windows-specific modifications to
do the same and do it properly.  For example, you would need a client that
runs on every interactive user desktop on the system, and then cron would
need to perform inter-process communication to instruct the client to run
the job for a user if it's an interactive job.  Additionally, you'd need to
make sure that this is done securely and you don't run the job for users who
aren't supposed to have the job run.  I don't know a lot about cron, but I'm
guessing all this architecture simply doesn't exist and creating it would be
a lot of effort.  If the built-in task scheduler can do what you need, why
hassle with trying to make cron work?

Actually, it might be an interesting project to synchronize a cron
configuration with the Windows task scheduler.  Sort of a cron-compatible
front-end but with the standard task scheduler back-end.


--
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



More information about the Cygwin mailing list