Hmm... now I'm tearing my hair out.
I understand I need my mount_afp commands in /etc/rc.local, but I am having some problems. If I have the following commands in rc.local, the device mounts okay, but it's mounted as root so my other software can't access it:
Code:
# /etc/rc.local
mkdir /Volumes/my_mount_point
mount_afp afp://user:pass@192.168.0.2/folder /Volumes/my_mount_point
So I tried to run the commands by sudoing to the user I needed it to be mounted under, like this:
Code:
# /etc/rc.local
sudo -u sysadmin mkdir /Volumes/my_mount_point
sudo -u sysadmin mount_afp afp://user:pass@192.168.0.2/folder /Volumes/my_mount_point
But the mount_afp command would fail, with the following error (from /var/log/system.log):
Code:
# /var/log/system.log
myhostname sudo[141]: root : TTY=unknown ; PWD=/ ; USER=sysadmin ; COMMAND=/sbin/mount_afp afp://user:pass@192.168.0.2/directory /Volumes/my_mount_point
com.apple.SystemStarter[51]: mount_afp: [b]AFPMountURL returned error -1069 errno is -1069[/b]
error 1069 apparently occurs when the device to be mounted cannot be found, but it's definitely there, and if I run the mount_afp command when logged in as sysadmin, it works.
Does anyone have any ideas? Can I just mount it as root and then chown to sysadmin? I tried adding chown sysadmin -R /Volumes/my_mount_point to the first script, but it failed.
I am running out of ideas given my limited experience with unix, and apple's extensions to it. Any help, even a poke in the right direction, would be much appreciated.