smb_mount fails when run through launchd
I'm stumped. I have a script that I run hourly through launchd that makes sure my Mac is connected to the network shares it requires. It's a perl script and it iterates through an array of server and shares to make sure it's connected. For each, it calls the shell using mount_smbfs.
Here's the code that connects:
*print "Attempting to connect to \"$shareName\" on \"$serverName\".\n";*
*`mkdir '/Volumes/$shareName'`;*
*`mount_smbfs //$serverName/$shareName '/Volumes/$shareName'`;*
When I run this script from the command line, it works flawlessly, every time. When I run the same script through launchd, any shares that are disconnected produce this kind of error in the system log:
*smb_mount: open session failed!: syserr = Broken pipe*
*mount_smbfs: mount error: /Volumes/production: Broken pipe*
The weird thing is that I have this same script set up in launchd to run when I log in and it works at log in. It's the hourly attempts that fail. I've checked and they are the exact same command for each.
Any ideas?
Message was edited by: Rick Anderson
Message was edited by: Rick Anderson
Here's the code that connects:
*print "Attempting to connect to \"$shareName\" on \"$serverName\".\n";*
*`mkdir '/Volumes/$shareName'`;*
*`mount_smbfs //$serverName/$shareName '/Volumes/$shareName'`;*
When I run this script from the command line, it works flawlessly, every time. When I run the same script through launchd, any shares that are disconnected produce this kind of error in the system log:
*smb_mount: open session failed!: syserr = Broken pipe*
*mount_smbfs: mount error: /Volumes/production: Broken pipe*
The weird thing is that I have this same script set up in launchd to run when I log in and it works at log in. It's the hourly attempts that fail. I've checked and they are the exact same command for each.
Any ideas?
Message was edited by: Rick Anderson
Message was edited by: Rick Anderson
Mac OS X (10.5.8)