...
OS X 10.4+ uses the launchd
daemon for startup services. Getting OFBiz to run as a server is really simple using this approach.
1. Create the org.apache.ofbiz.plist
configuration file. A plist
configuration file is nothing more than an XML
file with the .plist
extension. Use the sample script below (but be sure to change the WorkingDirectory
property and create a file named org.apache.ofbiz.plist
:
...
You can change the RunAtLoad
property if you want to stop OFBiz auto-starting.
1 2. To test the startup script you use launchctl
. The following command will start OFBiz
as the current user:
...
Code Block |
---|
$ launchctl unload org.apache.ofbiz.plist |
3. Deploy the startup script (assumes running as root):
Code Block |
---|
$ sudo chown root:wheel org.apache.ofbiz.plist
$ sudo mv org.apache.ofbiz.plist /Library/LaunchDaemons/
|
You can now reboot and have OFBiz startup automatically. To load the script without rebooting you run the load command as root.
Code Block |
---|
$ sudo launchctl load /Library/LaunchDaemons/org.apache.ofbiz.plist |
4. To stop/start the process after it has been loaded either by rebooting or by running the load command you can run the following:
To Stop (note that the .plist is not specified for starting/stopping):
Code Block |
---|
$ sudo launchctl stop org.apache.ofbiz
|
To Start
Code Block |
---|
$ sudo launchctl start org.apache.ofbiz |