Re: Osascript and ssh
Re: Osascript and ssh
- Subject: Re: Osascript and ssh
- From: Nigel Smith <email@hidden>
- Date: Thu, 29 Apr 2004 13:03:33 +0100
On 29/4/04 10:15, "Axel Luttgens" <email@hidden> wrote:
>
Just a guess.
>
Does your calling script really need to run as nobody?
OK. We need some background, something I was trying to avoid boring the list
with *before* I had a solution :-)
Apple's new Xgrid software is an ad-hoc distributed parallel processing
system, allowing you to use idle systems to do work. Think Seti@Home, but
where you solve the problems *you* want. You have a controller and some
agents -- the controller sends a portion of the job to an agent and when the
agent is finished it returns the results. It is then availble for the next
part of the job.
A trivial example. I want to sum the numbers from 1 to 100. I could do it
all on my machine, but it would take *way* too long :-) So I split it up
into batches of 10 -- sum 1 to 10, sum 11 to 20, etc -- and put it out to
the agents.
Machine 1 is asked to do 1-10, returns the results, is asked to do 51-60
Machine 2 (the slowest, unfortunately) is asked to do 11-20 and returns the
results
Machine 3 (the fastest) finishes 21-30, does 31-40, 41-50, then 61-70,
71-80, 81-90, 91-100
The controller can then sum the results for the final answer.
The agents run their processes as "nobody" for security -- fine for shell
scripts and command line stuff, and you can even use AppleScript for a
problem like the above.
But wouldn't it be neat if you could use Photoshop or Acrobat like this? A
room full of machines crunching away at files after everyone had left for
the night! But an osascript call from "nobody" cannot interact with the UI.
One way round this is ssh to localhost, using the account of a logged-in GUI
user, hence user "nobody" sending the command when user "nigel" is logged
in:
ssh nigel@127.0.0.1 "osascript -e 'do stuff'"
Only useful if there is some way to also script in the password stage.
>
For that very precise question, the only way I can think of is to use
>
expect, that comes bundled since 10.3.
Perhaps that will do it.
>
Of course, this would require the password to be stored somewhere in clear.
Or passed as one of the parameters of the Xgrid job (later versions of Xgrid
may use SSL to pass jobs around). I also envisage the GUI account used to be
limited using standard OSX security features such as "Limitations" in the
"Accounts" control panel, locked screen, etc.
Another way of doing all this, rather than using ssh/osascript, would be to
use Remote Apple Events. I was avoiding this because I find Photoshop to be
unscriptable over eppc://. But I've had another idea -- a stay-open script
application which listens for Remote Apple Events and passes them on to the
local Photoshop. I'll try this later.
If you want more (and better!) info about Xgrid, take a trip over to
<
http://www.apple.com/acg/xgrid/>, where you'll also find a technology
preview to play with.
May not be useful to your average user/scripter, but every now and then we
have someone post here who has 1000 image files to process, or PDFs to
convert, or whatever. Imagine if they could use the idle machines in their
group to do overnight what would normally take a dedicated Mac all day to do
-- all without having to write their own batch-control scripts?
Hope that explains things better,
Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.