The Apache OFBiz is an Apache top-level project that implements a fully functional open source ERP. As any other application server, it is interesting to control its startup using either Upstart or systemd. Based on my previous post Creating Red Hat Wildfly systemd service for Ubuntu 16.04, I created a very simple systemd script to control the start/stop of the OFBiz service.
This file is called ofbiz.service and is located inside the directory /etc/systemd/system
:
|
|
This systemd service uses the Apache Ant scripts to start and stop OFBiz so it was necessary to add the WorkingDirectory directive to ensure that Ant will run inside the home directory of the application. It is important to notice that this service definition will use the Ant binaries that comes with the OFBiz distribution package so it is not necessary to install an external copy of Ant in order to use this systemd service definition script.
If you are using an external database service as well, make sure that OFBiz will not start only after the DBMS service by adding the service name into the directive After: This is an example for the PostgreSQL database:
|
|
After the script is ready, you will need to refresh the systemd daemon in order to make it available to be used. Furthermore, the service will not be enabled by default, so do not forget to enable it in order to get it up automatically after a system reboot. For further information about the handling of the please check the post Creating Red Hat Wildfly systemd service for Ubuntu 16.04.