delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/08/10/10:37:08

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RCVD_IN_SORBS_WEB,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
From: "James Johnston" <JamesJ AT motionview3d DOT com>
To: <cygwin AT cygwin DOT com>
References: <1344396878 DOT 20779 DOT 140661112064606 DOT 7AB245A7 AT webmail DOT messagingengine DOT com> <50248A39 DOT 1040209 AT cygwin DOT com>
In-Reply-To: <50248A39.1040209@cygwin.com>
Subject: RE: running interactive process on xp through cron not working
Date: Fri, 10 Aug 2012 14:36:28 -0000
Message-ID: <012e01cd7705$881dab40$985901c0$@motionview3d.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019