[launchd-dev] fork & exit in Shell Script (Revisited)

Charles Darwin darwinskernel at gmail.com
Wed Nov 19 11:09:34 PST 2008


On Nov 19, 2008, at 1:25 PM, Quinn wrote:

> [Whoops, I missed your email from Friday.]
>
> At 16:23 -0500 14/11/08, Charles Darwin wrote:
>>> That's probably true, but there are certain advantages to using a  
>>> login item, namely that a login item doesn't have to be code: it  
>>> can be anything that the Finder can open.  You can solve this  
>>> probably with no code by simply creating an alias to the server  
>>> volume in question and adding that alias to the login item list.
>>
>> I have 10 machines here so that is practically impossible to do.
>
> Keep in mind that there's a programmatic API both for creating  
> aliases and adding them to the login item list.
>
>> Then what is the purpose of having that (mount_afp utility that  
>> is) installed on your system?
>
> The mount tools exist primarily for historical reasons.  On  
> standard user systems out in the field, all mounting is handled by  
> higher level infrastructure (Disk Arb, URLMount framework,  
> automount).  This high-level infrastructure invokes these mount  
> tools, but that's really just an implementation detail.  It's  
> perfectly fine to invoke the mount tools directly, as long you  
> understand the consequences of doing so.  However, if your goal is  
> to have the system act like the volume was mounted by the user,  
> it's a good idea to mount the volume using the same APIs that get  
> invoked when the user mounts the volume (that is,  
> FSMountServerVolumeSync).
>
>> I don't care if it relaunches for that session (which in my script  
>> it doesn't by the way) what I can't get launchd to is to relaunch  
>> it when user logs out and then logs back without rebooting the  
>> system.
>
> I missed this aspect of the problem so, just to be sure, I tested  
> my script to ensure that it correctly gets relaunched in the  
> "logout then log straight back in" scenario, which it does.
>
> S+E
> -- 
> Quinn "The Eskimo!"                    <http://www.apple.com/ 
> developer/>
> Apple Developer Relations, Developer Technical Support, Core OS/ 
> Hardware
>

Are you testing on 10.4? Here I have:
$ uname -r
8.11.0

and doesn't work.

Charles



More information about the launchd-dev mailing list