TurboFloatServer not working with systemdAnswered

Below is the code of the systemd unit  floatingserver.service:

[Unit]
Description=Floating server LimeLM service
Wants=network-online.target
After=network-online.target

[Service]
Type=forking
User=root
Group=root
ExecStart=/home/testuser/devbin/TurboFloatServer -d -silent -config="/home/testuser/dev/etc/config.xml" -pdets="/home/testuser/dev/bin/data.dat" -pidfile="/home/testuser/dev/server.pid"
PIDFile=/home/testuser/dev/server.pid
#Restart=on-failure
[Install]
WantedBy=multi-user.target

systemctl start floatingserver.service fails with:

Job for floatingserver.service failed. See "systemctl status floatingserver.service" and "journalctl -xe" for details.
systemctl status floatingserver.service
● floatingserver.service - Floating server LimeLM service
  Loaded: loaded (/etc/systemd/system/floatingserver.service; disabled; vendor preset: disabled)
  Active: failed (Result: protocol) since Tue 2023-08-29 15:29:45 CEST; 10s ago
 Process: 14869 ExecStart=/home/testuser/dev/bin/TurboFloatServer -d -config="/home/testuser/dev/etc/config.xml" -pdets="/home/testuser/dev/bin/data.dat" -pidfile="/home/testuser/dev/server.pid" (code=exited, status=0/SUCCESS)
Main PID: 6559 (code=exited, status=1/FAILURE)
Aug 29 15:29:45 localhost.localdomain systemd[1]: Starting Floating server LimeLM service...
Aug 29 15:29:45 localhost.localdomain systemd[1]: Can't open PID file /home/testuser/dev/server.pid (yet?) after start: No such file or directory
Aug 29 15:29:45 localhost.localdomain systemd[1]: Failed to start Floating Server LimeLM service.
Aug 29 15:29:45 localhost.localdomain systemd[1]: Unit floatingserver.service entered failed state.
Aug 29 15:29:45 localhost.localdomain systemd[1]: floatingserver.service failed.

Tried many variants with timeouts and such but it always fails to have the PID file. The command TurboFloatServer -x works, but it needs to be invoked with daemonize tool in order to make it a proper daemon… which should be really handled properlly by the -d option.

Any example of a working systemd unit file service ?

Answer

Don't use -d it's not meant to be used from a process that expects the launched process to stick around. It's only useful when running from a terminal window session.

Use -x -silent -pdets="INSERT" -config="INSERT"

systemd can determine the PID at runtime. So don't bother with it.

TurboFloat Server must, of course, be activated before you run it from systemd (or anywhere else for that matter). So, if it fails to start, check your TFS log (set in the config file).

, edited

Sorry to report but it doesn't work with -x:

[Unit]
Description=Floating server LimeLM service
Wants=network-online.target
After=network-online.target

[Service]
Type=forking
User=root
Group=root
ExecStart=/home/testuser/dev/bin/TurboFloatServer -x -silent -config="/home/testuser/dev/etc/config.xml" -pdets="/home/testuser/dev/bin/data.dat" 
#Restart=on-failure
[Install]
WantedBy=multi-user.target

Fails with:

Aug 31 20:50:13 localhost.localdomain systemd[1]: Started Floating server LimeLM service.
Aug 31 20:50:13 localhost.localdomain FloatingServer[23601]: 2023-08-31, 20:50:13 <error>: Failed to load the product details file.
Aug 31 20:50:13 localhost.localdomain FloatingServer[23601]: 2023-08-31, 20:50:13 <error>: Failed to load the settings.
Aug 31 20:50:13 localhost.localdomain systemd[1]: floatingserver.service: main process exited, code=exited, status=1/FAILURE

This works fine if running in command-line

Any ideas ?

Sorry wrong copy paste, the Type is now left empty (=simple), not forking

Error is telling you exactly what is wrong.

Yea… and it works in command-line with same (root) user, so what's wrong ?

Lack of access likely.