Re: running shell in background....
Re: running shell in background....
- Subject: Re: running shell in background....
- From: Doug McNutt <email@hidden>
- Date: Sun, 2 Sep 2007 10:39:08 -0600
At 08:31 -0400 9/2/07, Mark J. Reed wrote, and I snipped:
>Adding the
>ampersand is not enough if you're running it from AppleScript via "do
>shell script", because the background job will still be attached to
>the "terminal" (not a visible one, in this case) that AppleScript
>started it in. Hence the redirections in my response.
There are real questions here that involve the way that Apple has added its GUI - Aqua - to the UNIX of old.
Who does "own" the background application or script that gets started? By own I'm talking about the hierarchy of processes that UNIX is where every process is started by another which remains its parent, or at least is supposed to.
When a GUI user logs in to a Mac he gets an environment that is not a shell and he can log off and pass control of the GUI to another user. He can also log in using a shell if he does it using ssh or telnet over a network.
What is the parentage of a background process that has been started by a previously logged in GUI user. Does it continue to run? To whom is a child died event sent? Can someone with the right privileges attach to it for control through ssh? Is it practical to start up, say, a daemon from a do shell script that would monitor a port or become a recipient on a named pipe?
The more I think about it the more I think initiating background processes ought to be carefully controlled for security purposes.
Mark says the process is owned by a terminal. Is that an instance of Terminal.app or is it assignment of a /dev/tty and /dev/pty pair? I would think that Terminal.app would have to be terminated when a user logs out. But does it? Do background jobs initiated under do shell script survive a user log-out operation?
Perhaps it's just that I wish I could understand Aqua.
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden