Issues using policy with mount AFP script

New Contributor

We have the following script running under a policy at startup and it works great.

echo "username attempting to mount a share"

# Mount share
sudo -u username /usr/sbin/jamf mount -server servername -share sharename -type afp -username username -password password

Problem is that if we happen to login as any user, then logout, for some reason the mount goes away. Anyone know why? Is it OS X doing this? Anyway around it? Do I have to create a logout policy to remount it?



Valued Contributor

Hey @mhatch14

Pretty sure this is an OS X issue. Think you need to change a preference file:

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool YES

New Contributor

I think you're right that it's an OS X issue. The issue being that when a user logs off, all processes related to that user, including volumes mounted via AFP, are ended.

In this case, I use Casper to mount an AFP volume as a user at startup. So even if no one logs in, the machine mounts this volume via AFP. Even if I login, the volume stays mounted. The moment I logout then the volume goes away. This is the behavior that I don't want.

I would like the volume to stay mounted.

I did try the preference that you sent me and unfortunately it did not change the behavior.