4

I want to use a Mac mini as a server. So I've installed tomcat and I want it to start automatically when booting. On Windows this is called a "services". I'm new to Mac OS but I read that this is a plist file in the /Library/LaunchDaemon folder.

So I found following link: https://gist.github.com/661713 I copied the files and inserted the correct paths.

But when I try to launch launchctl load /Library/LaunchDaemons/org.apache.tomcat.plist

I get the following errors:
launchctl: no plist was returned for: /Library/LaunchDaemons/org.apache.tomcat.plist launchctl: no plist was returned for: /Library/LaunchDaemons/org.apache.tomcat.plist nothing found to load

hering
  • 1,956
  • 4
  • 28
  • 43
  • Had the same problem. Changing the white spaces to just space characters and line endings to unix-style has helped. – wnrph Aug 01 '12 at 14:25

2 Answers2

4

I noticed I'm completely new to Mac. So changing the extension name of a file doesn't really mean to change the filetype :)
I wrote the plist with textedit, but it wasn't a "true" plist. So I created a plist with the property list editor and the error disappeared.

hering
  • 1,956
  • 4
  • 28
  • 43
  • EXACTLY! When I pasted in some code I found on the web and saved it in TextEdit and renamed to .plist, it kept a bunch of garbage html/hex which was not ever displayed in TextEdit. Opening the .plist (which I created in TextEdit and renamed) in Unitron instead enabled me to modify the contents and remove the garbage code. Now it works and loads! – ATSiem Jul 18 '12 at 00:37
  • 1
    Another good way to troubleshoot this is to keep the `console` application running while you run `launchctl load` then look at the output to the system log to see what is going wrong. – Gili Aug 29 '12 at 15:19
2

The illegal characters that stop this launching are usually the spaces for indentation. Re-edit the file with nano, and remove spaces and reindent with Tab. That fixed the problem for me.