# English (German below)
Hello, I would like to pick up this thread because I used the information from here to write a systemd service unit of my on for the TeamDrive Personal Server (version 1.1.070), today. My service unit looks like:
- Code: Select all
$ cat /etc/systemd/system/tdps.service
[Unit]
Description="TeamDrive Personal Server"
After=network.target
[Service]
User=tdps
PIDFile=/opt/tdps/tdpsd.pid
ExecStart=/opt/tdps/tdpsd -c /opt/tdps/tdps.config -m /opt/tdps/mime.types -w /opt/tdps
ExecStop=/opt/tdps/stop-tdps -p /opt/tdps/tdpsd.pid
KillMode=process
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=yes
[Install]
WantedBy=multi-user.target
I'm able to successfully start the service. But each time I stop it via
- Code: Select all
sudo systemctl stop tdps.service
the unit fails with following status:
- Code: Select all
$ sudo systemctl status tdps.service
● tdps.service - "TeamDrive Personal Server"
Loaded: loaded (/etc/systemd/system/tdps.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2020-08-08 14:43:56 CEST; 8min ago
Process: 26963 ExecStart=/opt/tdps/tdpsd -c /opt/tdps/tdps.config -m /opt/tdps/mime.types -w /opt/tdps (code=exited, status=1/FAILURE)
Process: 26991 ExecStop=/opt/tdps/stop-tdps -p /opt/tdps/tdpsd.pid (code=exited, status=0/SUCCESS)
Main PID: 26963 (code=exited, status=1/FAILURE)
Aug 08 14:43:18 vmd54920.contaboserver.net systemd[1]: Started "TeamDrive Personal Server".
Aug 08 14:43:55 vmd54920.contaboserver.net systemd[1]: Stopping "TeamDrive Personal Server"...
Aug 08 14:43:55 vmd54920.contaboserver.net systemd[1]: tdps.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 14:43:56 vmd54920.contaboserver.net stop-tdps[26991]: TeamDrive Personal Server stopped
Aug 08 14:43:56 vmd54920.contaboserver.net systemd[1]: tdps.service: Failed with result 'exit-code'.
Aug 08 14:43:56 vmd54920.contaboserver.net systemd[1]: Stopped "TeamDrive Personal Server".
In /opt/tdps/tpdsd.log I found this:
- Code: Select all
===========================================
200808 14:43:55 TeamDrive Personal Server shutdown
200808 14:43:56 [Error] NetworkHandler2: void CSThread::throwSignal(CSThread.cc:404) Terminated (15)
200808 14:43:56 [Note] TeamDrive Personal Server no longer published
Well, the server is no longer published but I don't like the unit to fail. Does someone have an idea what to do so the service could be stopped without causing the unit to fail?
# Deutsch
Hi, ich greife dieses Thema auf, da ich auf dessen Basis selbst eine Service-Unit erstellt habe. Der Server lässt sich erfolgreich über die Service-Unit starten. Jedoch endet die Unit nach jedem Stopp des Dienstes im Status "failed". Meine Unit, der Status beim Stop und ein Auszug aus dem tdpsd.log sind in den obigen Code-Blöcken dargestellt.
Kann mir jemand erklären, warum die Unit beim Stopp des Dienstes in den Status 'failed' geht? Also warum der Exit-Status ungleich 0 ist? Ich vermute es hat etwas damit zu tun, dass der Prozess mit SIGTERM beendet wird, bin mir aber nicht sicher.
Was kann ich tun, um den Dienst zu stoppen und einen Fehlerstatus der Unit zu vermeiden?
MfG
Tronde