already running
vdr-transcode - swiss knife for transcoding
-
-
-
sudo -u vdr vt --ak
-
-
-
-
Ich hab mal in den Code geschaut - nachdem vt -as nicht forkt, sondern einfach weiter läuft und vt -ak nichts anderes macht als ein SIGTERM an den Prozess zu senden, kann man vt einfach unter Kontrolle von Systemd stellen (es darf natürlich keine weitere Instanz laufen, wenn die Systemd-Unit gestartet wird):
-
Habe es gerade getestet
Coderoot@stube:/home/frank# journalctl -u vt.service -b -l -- Logs begin at Fri 2022-01-14 01:55:02 CET, end at Tue 2022-05-31 17:57:02 CEST. -- Mai 31 17:56:29 stube systemd[1]: Started VDR transcode. Mai 31 17:56:29 stube vt[815]: already running Mai 31 17:56:29 stube systemd[1]: vt.service: Main process exited, code=exited, status=99/n/a Mai 31 17:56:29 stube systemd[1]: vt.service: Failed with result 'exit-code'. root@stube:/home/frank#
Code
Alles anzeigenroot@stube:/home/frank# systemctl status vt.service ● vt.service - VDR transcode Loaded: loaded (/lib/systemd/system/vt.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-05-31 17:56:29 CEST; 1min 13s ago Process: 815 ExecStart=/usr/local/bin/vt --as (code=exited, status=99) Main PID: 815 (code=exited, status=99) Mai 31 17:56:29 stube systemd[1]: Started VDR transcode. Mai 31 17:56:29 stube vt[815]: already running Mai 31 17:56:29 stube systemd[1]: vt.service: Main process exited, code=exited, status=99/n/a Mai 31 17:56:29 stube systemd[1]: vt.service: Failed with result 'exit-code'. root@stube:/home/frank#
Startet leider nicht
Habe auch testweise das System ausgeschaltet und wieder neu gestartet,leider ohne Erfolg
-
-
Code
root@stube:/home/frank# journalctl -u vt.service -b -l -- Logs begin at Sun 2022-01-16 09:21:38 CET, end at Tue 2022-05-31 18:36:38 CEST. -- Mai 31 18:36:05 stube systemd[1]: Started VDR transcode. root@stube:/home/frank#
Code
Alles anzeigenroot@stube:/home/frank# systemctl status vt.service ● vt.service - VDR transcode Loaded: loaded (/lib/systemd/system/vt.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2022-05-31 18:36:05 CEST; 1min 15s ago Main PID: 809 (vt) Tasks: 2 (limit: 9255) Memory: 5.9M CGroup: /system.slice/vt.service ├─ 809 /bin/bash /usr/local/bin/vt --as └─1500 sleep 60 Mai 31 18:36:05 stube systemd[1]: Started VDR transcode. root@stube:/home/frank#
-
Nach einem erneutem reboot kommt dann wieder Fehler
Code
Alles anzeigenroot@stube:/home/frank# journalctl -u vt.service -b -l -- Logs begin at Sun 2022-01-16 09:21:38 CET, end at Tue 2022-05-31 18:39:10 CEST. -- Mai 31 18:38:32 stube systemd[1]: Started VDR transcode. Mai 31 18:38:32 stube vt[814]: already running Mai 31 18:38:32 stube systemd[1]: vt.service: Main process exited, code=exited, status=99/n/a Mai 31 18:38:32 stube systemd[1]: vt.service: Failed with result 'exit-code'. root@stube:/home/frank# systemctl status vt.service ● vt.service - VDR transcode Loaded: loaded (/lib/systemd/system/vt.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-05-31 18:38:32 CEST; 47s ago Process: 814 ExecStart=/usr/local/bin/vt --as (code=exited, status=99) Main PID: 814 (code=exited, status=99) Mai 31 18:38:32 stube systemd[1]: Started VDR transcode. Mai 31 18:38:32 stube vt[814]: already running Mai 31 18:38:32 stube systemd[1]: vt.service: Main process exited, code=exited, status=99/n/a Mai 31 18:38:32 stube systemd[1]: vt.service: Failed with result 'exit-code'. root@stube:/home/frank#
Seltsam
-
-
Looks like vt "believes" it's still running, probably due to a persistent and not deleted statefile.
Just tested, here it puts a /run/vt_server.pid. @ first run (directly started) and doesn't delete that file when "vt --ak".
But then, this file isn't hindering a restart and just stayed there - it was not updated on a 2nd "vt --as".
Puzzled ...
-
It is correct that the pid-file will not deleted at at --ak , but that makes no problem, everything works fine.
-
But then, if vt doesn't remember the state although it may be killed by systemd (since no "ExecStop" was provided), the fault must be in systemd.
I would add the "ExecStop = vt --ak" line to the service section and try if that helps.
-
vt compares the content of the vt file with the existing pids in the system to determine if it is already running: https://github.com/jsffm/vdr-t…aster/vdr-transcode#L3632 - this can give false positives because a pid isn't unique across reboots. A quick way to fix this yould be to delete the pid file before starting the process (a better way would be to put the pid file into /run/$USER/, so it is lost when the system reboots):
Code[Unit] Description=VDR transcode [Service] Type=simple User=vdr ExecStartPre=rm -f %h/vdr-transcode/vt_server.pid ExecStart=/usr/local/bin/vt --as StandardOutput=journal [Install] WantedBy=multi-user.target
Systemd sending a SIGTERM to the process should not be a problem, that's the only important thing the server_kill function does: https://github.com/jsffm/vdr-t…aster/vdr-transcode#L3677
-
I guess /run/$USERmust be created as root after every start
Why do we speak english?
-
Why do we speak english?
Hehe, ich glaub ich hab vor dem Artikel, auf den ich zuerst geantwortet hab, *irgendwas* englisches gelesen hier
Vielleicht eine systemd-manpage ...
-
Ich kann nur Ost-Deutsch
-
[Unit]
Description=VDR transcode
[Service]
Type=simple
User=vdr
ExecStartPre=rm -f %h/vdr-transcode/vt_server.pid
ExecStart=/usr/local/bin/vt --as
StandardOutput=journal
[Install]
WantedBy=multi-user.targetHab es gerade probiert,leider ohne Erfolg,da fehlen wohl root Rechte
Coderoot@stube:/home/frank# journalctl -u vt.service -b -l -- Logs begin at Fri 2022-01-21 14:16:02 CET, end at Wed 2022-06-01 14:40:04 CEST. -- Jun 01 14:38:36 stube systemd[1]: Starting VDR transcode... Jun 01 14:38:36 stube rm[814]: /usr/bin/rm: das Entfernen von '/root/vdr-transcode/vt_server.pid' ist nicht möglich: Keine Berechtigung Jun 01 14:38:36 stube systemd[1]: vt.service: Control process exited, code=exited, status=1/FAILURE Jun 01 14:38:36 stube systemd[1]: vt.service: Failed with result 'exit-code'. Jun 01 14:38:36 stube systemd[1]: Failed to start VDR transcode.
Code
Alles anzeigenroot@stube:/home/frank# systemctl status vt.service ● vt.service - VDR transcode Loaded: loaded (/lib/systemd/system/vt.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2022-06-01 14:38:36 CEST; 1min 57s ago Process: 814 ExecStartPre=/usr/bin/rm -f /root/vdr-transcode/vt_server.pid (code=exited, status=1/FAILURE) Jun 01 14:38:36 stube systemd[1]: Starting VDR transcode... Jun 01 14:38:36 stube rm[814]: /usr/bin/rm: das Entfernen von '/root/vdr-transcode/vt_server.pid' ist nicht möglich: Keine Berechtigung Jun 01 14:38:36 stube systemd[1]: vt.service: Control process exited, code=exited, status=1/FAILURE Jun 01 14:38:36 stube systemd[1]: vt.service: Failed with result 'exit-code'. Jun 01 14:38:36 stube systemd[1]: Failed to start VDR transcode. root@stube:/home/frank#
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!