Staying connected to shares: bizarre solution
For the last few months, I've been working to keep a Mac in our system that carries out automated processing tasks connected to a number of network shares. I wrote a shell script that mounts the shares and I run it through launchd at login (and every 10 minutes to pick up any dropped connections.) When it runs though launchd, it produces "broken pipe" errors in the system log and it never connects to any shares. If I run the script from the command line, it connects, no errors.
After working through numerous theories about this, I discovered today that the script won't actually connect to the shares unless a Finder window is open that shows the icons of the shares.
This means the script works through launchd if I start it with this command:
*open /*
That pops open a Finder window and the shares subsequently connect just fine. If I leave that part out, no go. I get the "broken pipe" errors in the system log.
Can anyone explain to me why this is the case? I don't mind having to do that, but after several months of pulling my hair out, I'd at least like to have an understanding of what causes this.
The machine is running 10.5.8, btw.
Here's a snippet of the login script I'm running. Pretty basic stuff.
*mkdir '/Volumes/Pags'*
*mount_smbfs //bez-adv2/Pags /Volumes/Pags*
*mkdir '/Volumes/data'*
*mount_smbfs //bez-adv2/data /Volumes/data*
*mkdir '/Volumes/personal_folders'*
*mount_smbfs //bez-nwed/personal_folders /Volumes/personal_folders*
etc...
Message was edited by: Rick Anderson
Message was edited by: Rick Anderson
Message was edited by: Rick Anderson. Needed to clean up formatting of the script snippet I'd posted.
Mac OS X (10.5.8)