Launchd script to mount volume on boot I have a script monta.sh to mount an external volume:

#!bin/sh
mkdir -p /Volumes/remvol
mount_smbfs //user:password@server/folder /Volumes/remvol


Then I have a com.jo.monta.plist to launch the script after system boot placed in /Library/LaunchDaemons:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.jo.monta&lt;/string&gt;
    &lt;key&gt;Disabled&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;UserName&lt;/key&gt;
    &lt;string&gt;admin&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/Users/admin/scripts/monta.sh&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;SuccessfulExit&lt;/key&gt;
        &lt;false/&gt;
    &lt;/dict&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


I've tested the script from the command line and it works, however if I log in after boot the volume is not mounted.

It seems like the plist file doesn't load? what's wrong?
The script and the plist work perfectly well if you make following changes:

add a slash in /Users/admin/scripts/monta.sh:

#!/bin/sh
mkdir -p /Volumes/remvol
mount_smbfs //user:password@server/folder /Volumes/remvol


proper ownership of com.jo.monta.plist:

sudo chown root:wheel /Library/LaunchDaemons/com.jo.monta.plist


proper file mode bits of /Users/admin/scripts/monta.sh:

chmod 755 /Users/admin/scripts/monta.sh


load the launch daemon:

sudo launchctl load /Library/LaunchDaemons/com.jo.monta.plist