Monday, February 16, 2015

Tomcat doesn't starts on boot (Yosemite) or launchctl operation already in progress

After Yosemite, Tomcat installation refused to start on boot. When trying to start it manually, using:

sudo launchctl load /Library/LaunchDaemons/org.apache.tomcat.plist


failed with message:

launchctl operation already in progress


It took me a while to discover that:

  • launchctl has changed a lot after Yosemite (and you need to read the only available documentation, man launchctl)
  • most commands (like load) are in deprecated mode
  • all tomcat files where with "@" extended attribute (ls -l@ gives a list with extended attributes) meaning that are signed with "com.apple.quarantine" (you need to approve execution explicitly on the first run)
  • the command:

    launchctl print-disabled system


    lists org.apache.tomcat as disabled

Solution:
- Remove the quarantine attribute
xattr -r -d com.apple.quarantine /opt/servers/Tomcat/TomcatHome

- Enable service
sudo launchctl enable org.apache.tomcat

- Add service to the system domain
sudo launchctl bootstrap system /Library/LaunchDaemons/org.apache.tomcat.plist

No comments:

Post a Comment