Creating a Launch Daemon plist to run at startup
Hi All
I am just messing around and wanted to see if I could create a LaunchDaemon that would load on system start up and I seem to be doing something wrong.
I used Lingo to help me create a plist.
I was able to load the plist in to /Library/LaunchAgent/ and the plist ran when I logged in. The plist would not run on system startup, even though the plist does indicate to load on start up: "<key>RunAtLoad</key> <true/>"
I then moved the file to /Library/LaunchDaemon/. The plist is set to root:wheel permissions but it will not load on system startup nor on when I login.
I use launchctl in terminal to see what is running.
If I load the plist through launchctl, the plist will run and work just fine. However the point is to get it to load at system startup.
Any ideas? I am sure I am doing something wrong.
I have the plist at the bottom of this post.
The plist is pointing to a small script which just puts the date in to a file so I can see how often and when the plist was loaded and ran. Everything is included at the bottom.
PLIST START:
<?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.kaa.imageremover-hourly</string>
<key>ProgramArguments</key>
<array>
<string>/Users/MyUser/Desktop/script1.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>1</integer>
</dict>
</plist>
PLIST END
-------------------------------------------
SCRIPT START:
#!/bin/sh
echo "files removed at" >> /Users/MyUSER/Desktop/testfile.txt
date >> /Users/MyUSER/Desktop/testfile.txt
echo " " >> /Users/MyUSER/Desktop/testfile.txt
SCRIPT END
iMac / MacPro/ MacBook Pro / MacBook / OS X Server, Mac OS X (10.6.4), Experience with Active Directory OUs/GPOs, Windows 2003/XP
