| xwiki.service runs start_xwiki.sh, the generic script of the Jetty distribution. Under systemd this costs, on every start and for the whole life of the service:
- a full extra JVM (java -version) to check the Java version, which the package dependencies already guarantee;
- a shell and a sleep 1 loop kept running beside Jetty to delete a lock file once Java exits: one fork and exec per second, in the service's cgroup;
- ExecStop runs stop_xwiki.sh, which starts up to two more JVMs before falling back to kill and kill -9, all of which systemd does itself (KillSignal, TimeoutStopSec).
Starting java directly from the unit (options in an environment file, directories from StateDirectory=/LogsDirectory=) would remove all of this. It would also allow restricting what the service may execute (NoExecPaths=/ExecPaths=), which is impossible while a shell keeps running sleep. |