Running a command on startup

box

box

Associate
Joined
20 Nov 2005
Posts
1,228
Location
Bristol
I've been trying to get the 'Stolen MacBook tracking script' here working on my MBP, but seem to be having some trouble. The actual script works fine, but I can't seem to get the system to launch the .plist file at startup. I've confirmed it isn't running with a 'sudo launchctl list' command. However, I can successfully start it manually using 'sudo launchctl load -F /Library/LaunchDaemons/checkin.plist'. I don't know my way around terminal that well. These are just commands I've picked up from scouring discussion forums!

The plist file reads as follows:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

	<key>Disabled</key>
	<false/>

	<key>Label</key>
	<string>checkin</string>

	<key>Program</key>
	<string>/Applications/Utilities/checkin</string>

	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Utilities/checkin</string>
	</array>
	
	<key>StartInterval</key>
	<integer>1800</integer><!-- run every 1800 seconds -->
	
	<key>RunAtLoad</key>
	<true/>

</dict>
</plist>

I'm at a loss. Can anyone shed some light?

Cheers!
 
Maybe I'm being a bit silly here but have you tried going into System Preferences, then 'Accounts', the 'Login Items' and clicking the '+' underneath the list of applications that automatically launch?
In order for this to work your system would need to log you on automatically when the computer is booted up as this is a per user setting. :(

There is a System/Library/StartupItems folder, perhaps it could go in there?
Or create a .sh file in text editor and paste in 'sudo launchctl load -F /Library/LaunchDaemons/checkin.plist'. I've no idea if that would work, though :p
 
Last edited:
Back
Top Bottom