User=<user to run as>
Depending on your flavour of Linux, there are likely a few different ways you can run TomEE as a service. This page demonstrates running as a service with systemd, and has been tested with RedHat Enterprise Linux.
Create a file
/etc/systemd/system/tomee.service with the following content:
The file above assumes TomEE is extracted to
/opt/tomee, and that
JAVA_HOME is at
/usr/lib/jvm/jre - adjust these to match your installation.
Once done, run
sudo systemctl daemon-reload so systemd is aware of the new service.
You should now be able to use the following commands to control the TomEE service:
sudo systemctl start tomee(to start TomEE)
sudo systemctl stop tomee(to stop TomEE)
sudo systemctl status tomee(to check the status of the TomEE service)