Description
Following has been reported at the users mailinglist by sekaijin:
On MacOS Systems:
create a texte file named org.apache.karaf.KARAF.plist (where KARAF is the name of your karaf wrapper)
<?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>ProcessType</key> <string>Background</string> <key>KeepAlive</key> <false/> <key>Label</key> <string>org.apache.karaf.KARAF</string> <key>ProgramArguments</key> <array> <!-- path to your KARAF-service wrapper --> <string>/Users/jeanyves/karaf/apache-karaf-2.3.3/bin/KARAF-service</string> <string>console</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
On MacOS you can install the service for an user or for the system.
to add org.apache.karaf.KARAF as user service move this file into ~/Library/LaunchAgents/
> mv org.apache.karaf.KARAF.plist ~/Library/LaunchAgents/
to add org.apache.karaf.KARAF as system service move this into /Library/LaunchDaemons
> sudo mv org.apache.karaf.KARAF.plist /Library/LaunchDaemons/
change owner and rights
> sudo chown root:wheel /Library/LaunchDaemons/org.apache.karaf.KARAF.plist
> sudo chmod u=rw,g=r,o=r /Library/LaunchDaemons/org.apache.karaf.KARAF.plist
test your service
> launchctl load ~/Library/LaunchAgents/org.apache.karaf.KARAF.plist
> launchctl start org.apache.karaf.KARAF
> launchctl stop org.apache.karaf.KARAF
after restart your session or system
you can use launchctl command to start and stop your service