Skip navigation
This discussion is archived

smb_mount fails when run through launchd

981 Views 0 Replies Latest reply: Aug 25, 2009 1:17 PM by Rick Anderson RSS
Rick Anderson Level 2 Level 2 (165 points)
Currently Being Moderated
Aug 25, 2009 1:17 PM
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
Mac OS X (10.5.8)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.