VERY simple Launchd plist not running my script

Viewed 44805

I'm trying to figure out why my launchd script is not working. It is extremely simple, but I am new to the mac environment and trying to get accustomed. Here's my plist. I know ProgramArguments is required, so I just put the script path in there.

<?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.tomcat.plist</string>   
  <key>ProgramArguments</key>  
  <array>  
    <string>/opt/apache-tomcat-5.5.27/bin/startup.sh</string>  
  </array>  
  <key>OnDemand</key>  
  <false/>  
</dict>  
</plist>

When I try to run launchctl load <name> it seems to load properly (in that it doesn't give me any error messages), but the script doesn't seem to be executing, even on reboot.

I've used all the examples I've found online and I can't figure out why this isn't running my script on start up.

3 Answers

Although I imagine most people will not have this problem, I figure it is worth putting here since I spent nearly two hours trying to figure out why launchd load was not working despite returning a 0 exit code.

The problem was simple. My plist file had the wrong file extension (I had "plst"), and launchctl was silently refusing to load the file. Changing the extension to plist resolved the issue.

Related