Papermc.service: Failed with result 'exit-code'

Hello,
I installed papermc and wanted to tweak the java heap memory max from default 1024mb to 2048m (I run it on a 4GB raspi 4).
I edited the service via DietPi-Services like mentioned here Gaming and Emulation Software Options - DietPi.com Docs.

When I try now to start the service I get this error message:

papermc.service: Failed with result 'exit-code'.

systemctl status papermc.service gives me this:

 papermc.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.

So I guess it now uses the default ExecStart= and my uncommented ExecStart=, which is not a wanted behaviour?

You would need to add an additional ExecStart= before your tweak, to clear the original setting

Yes, this did the job!
my dietpi-services_edit.conf looks now like this:

[Unit]
#Description=PaperMC (DietPi)
#Documentation=https://paper.readthedocs.io/

[Service]
#SyslogIdentifier=PaperMC
#User=papermc
#WorkingDirectory=/mnt/dietpi_userdata/papermc
ExecStart=
ExecStart=/usr/bin/java -Xms1g -Xmx2g -jar /opt/papermc/paperclip.jar --nogui --noconsole

[Install]
#WantedBy=multi-user.target

So to who can I write to correct the incorrect doc? (Gaming and Emulation Software Options - DietPi.com Docs)

MichaIng
should we add this to our docs to have an additional ExecStart= added?

Indeed that is missing! It is always required to unset the previous value, else it is handled as a second “ExecStart” directive, not supported on this type of service. Good find.

PR up: https://github.com/MichaIng/DietPi-Docs/pull/609

I have anothet issue.
I wanted to add start arguments to java, bc of the log4j security breach.

I edited the service via dietpi-services but the dietpi-services_edit.conf at /etc/systemd/system/papermc.service.d was not changed, but I see the changes in dietpi-services.

For now I edited the dietpi-services_edit.conf themself.


cheers

usually you could run systemctl cat papermc.service to see all config files on that service and their content.

SImply reinstall PaperMC, the newest version has Log4Shell mitigated natively:

dietpi-software reinstall 181