Problem with Launchd running bash script and bindfs
Hi, I have been trying to get a launchd script working and it's not working and this error appears in the system log:
10/10/12 12:35:44 PM com.sysadmin.bindfs[83] Not a valid user ID: user1
10/10/12 12:35:44 PM com.sysadmin.bindfs[83] Not a valid user ID: user2
What I'm aiming to do is run a sftp chroot for virtual hosts and mount the chroot folders that are linked to to the corresponding vhost folders in Library/Webserver/Documents folder.
I've tested it and it works fine if I just run the commands or the script by itself via the terminal. The problem from there is that the bindfs mounts do not remount on startup. So I decided to make a launchd plist to located @ /Library/LaunchDaemons. I've been using Lingon (gui plist editor) to set it up as a Launch Daemon and call the script located in /usr/bin/bindfs.sh
I have chmod +x'ed the file and chowned to root. I've placed the script in /usr/bin (hope thats the correct or appropriate location and permissions)
#!/bin/bash
sudo /opt/local/bin/bindfs -u user1 /Library/Webserver/Documents/user1 /vhosts/user1/public_html
sudo /opt/local/bin/bindfs -u user2 /Library/Webserver/Documents/user2 /vhosts/user2/public_html
I've tried mucking around with the script ie removing sudo from the commands etc and its still not working.
The system is a 10.6.8 Snow Leopard Server.
What am I doing wrong? TIA
Shorts