Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Staying connected to shares: bizarre solution

I just solved a network connectivity problem we've been having but the solution leaves me completely baffled. A little background first...

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)

Posted on Oct 6, 2009 1:08 PM

Reply
4 replies

Oct 6, 2009 5:03 PM in response to etresoft

This is being run in an active directory environment so no user/passwords are needed. And as I said, if I run the script on the command line, it works. It seems to be a problem with running it in launchd.

And I'm by no means an expert on autofs, but I was under the impression that it could not mount SMB shares (which is what I'm trying to connect to in this case.) Can autofs handle SMB? I looked into that as a possible solution at one point, but the stuff I ran across made it sound like it can't be used that way.

Oct 6, 2009 5:17 PM in response to Rick Anderson

Rick Anderson wrote:
This is being run in an active directory environment so no user/passwords are needed. And as I said, if I run the script on the command line, it works. It seems to be a problem with running it in launchd.


I know very little about Active Directory. What I think I know is that a Mac using Active Directory gets its user information from the network. If this is true, how would it know which Active Directory user to mount against when it is running under launchd, before any user has logged in?

Usually mounts are user-specific. You don't want software engineers mounting //management/payroll.

And I'm by no means an expert on autofs, but I was under the impression that it could not mount SMB shares (which is what I'm trying to connect to in this case.) Can autofs handle SMB?


I was under a different impression. Try it.

Oct 6, 2009 6:31 PM in response to etresoft

I'll definitely look into it. I'd be happy to find out I'm wrong about that.

I've been tinkering with the login script however, adding in a user name as part of the connection command and having some luck, but it's still not consistent. It seems to fail at login and sometimes succeed when the script runs again 10 minutes later.

It's been in the back of my mind that maybe the machine is somehow failing to authenticate to Active Directory early enough in the process and maybe that's interfering with the ability to connect.

Right after rebooting, I see a bunch of messages in the system log from DirectoryServices along these lines

*enter machine password*

/SourceCache/samba/samba-187/samba/source/libads/kerberos.c:adskinitpassword(228)

*kerberos kinitpassword IPHONE-3@BEZ.DOMAINNAME.COM failed: Client not found in kerberos database*

Funny thing is that iphone-3 is not the name of the machine where this is running. That's something else entirely.

Staying connected to shares: bizarre solution

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.