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
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.jo.monta</string>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>admin</string>
<key>ProgramArguments</key>
<array>
<string>/Users/admin/scripts/monta.sh</string>
</array>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
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?
#!bin/sh
should be#!/bin/sh
– Graham Miln Feb 29 '16 at 8:14system.log
regarding this launchd job? You can see the contents ofsystem.log
using Applications > Utilities > Console.app. – Graham Miln Feb 29 '16 at 8:16com.jo.monta
in the system log, I have also usedlaunchctl list | grep monta
to see if there was something and no reference neither. – naio Feb 29 '16 at 8:45ProgramArguments
instead ofProgram
(which is a simple key/value pair, not an array, seeman launchd.plist
for details)? – nohillside♦ Feb 29 '16 at 9:31