Running midPoint with systemd

Last modified 22 Apr 2021 17:31 +02:00

This page describes the method how to setup midPoint server for systemd run control. This is the usual setup to start midPoint automatically after system boot on UNIX-like (Linux) systems.

The following steps assume the midPoint installation in /opt/midpoint directory, owned (both directory and its content) as (previously created) user midpoint. The service will be started as user midpoint and will listen on default TCP 8080 port.

  1. Create a new file /etc/systemd/system/midpoint.service with the following content:

    Description=MidPoint Standalone Service
    ExecStart=/usr/bin/java -Xmx2048m -Dmidpoint.home=/opt/midpoint/var -cp /opt/midpoint/lib/midpoint.war -Dloader.path=WEB-INF/classes,WEB-INF/lib,WEB-INF/lib-provided,/opt/midpoint/var/lib org.springframework.boot.loader.PropertiesLauncher

    ExecStart line for versions before 4.2 is different:

    ExecStart=/usr/bin/java -Xmx2048m -Dmidpoint.home=/opt/midpoint/var -jar /opt/midpoint/lib/midpoint.war
  2. Run the following commands to enable midpoint service:

    sudo systemctl daemon-reload
    sudo systemctl enable midpoint
  3. Start midPoint as systemd service using the following command:

    sudo systemctl start midpoint
  4. You can monitor the startup in /opt/midpoint/var/log/midpoint.log (standard midPoint log) or in /var/log/syslog (the file name may vary; if systemd is used, /opt/midpoint/var/log/midpoint.out is not used.

  5. You can stop midPoint as systemd service using the following command:

    sudo systemctl stop midpoint
  6. To disable automatic midPoint startup/shutdown, use the following command:

    sudo systemctl disable midpoint

If you wish to customize JVM parameters, just modify ExecStart directive in the midpoint.service file and restart midPoint.

Systemd allows you to specify service dependencies. For example to specify that midPoint requires PostgreSQL database (running as systemd service on the same host), just uncomment the lines Requires and After. Systemd will start PostgreSQL before midPoint, and when PostgreSQL goes down, it will also automatically shutdown midPoint.