| xwiki.service, from xwiki-xjetty-common, has Restart=on-abort. On a host with cgroup v2, when the kernel's OOM killer kills the JVM, systemd ends the unit with the result oom-kill. Restart=on-abort only covers a process killed by an uncaught signal, so the unit stays failed and XWiki stays down until someone starts it. On cgroup v1 systemd only sees a process killed by a signal, and the same unit is restarted. So the behaviour changed with the move of distributions to cgroup v2. Steps to reproduce
- Install xwiki-xjetty-pgsql 18.9.0 on Debian 13 (cgroup v2, systemd 257).
- Limit the memory of the unit below what the JVM may use: a drop-in with MemoryMax=1200M, MemorySwapMax=0 and JDK_JAVA_OPTIONS=-Xmx4g, then restart.
- Make XWiki use more memory than the limit.
Result
systemctl show xwiki.service then gives ActiveState=failed, Result=oom-kill, NRestarts=0. Expected XWiki is started again, as it is after a crash. Restart=on-failure covers this case. Seen also on Debian 12 (systemd 252) and Ubuntu 26.04 (systemd 259). Debian's own tomcat10 and tomcat11 units have the same Restart=on-abort, so the Tomcat packages behave the same; that unit is not XWiki's. |