Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
shutdown -r now


OS X (10.4+)

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:
Code Block

<?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>Disabled</key>
	<false/>
	<key>Label</key>
	<string>org.apache.ofbiz</string>
	<key>WorkingDirectory</key>
	<string>/Users/jaz/Sandbox/ofbiz</string>
	<key>ProgramArguments</key>
	<array>
		<string>./startofbiz.sh</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>

You can change the RunAtLoad property if you want to stop OFBiz auto-starting.

  1. To test the startup script you use launchctl. The following command will start OFBiz as the current user:
Code Block

$ launchctl load org.apache.ofbiz.plist

You can view the status and process ID by running:

Code Block

$ launchctl list | grep ofbiz

To unload the service after confirming it is working, run:

Code Block

$ launchctl unload org.apache.ofbiz.plist
  1. 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
  1. 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