transmission / transmission

Official Transmission BitTorrent client repository
https://transmissionbt.com
Other
11.98k stars 1.2k forks source link

transmission-daemon fails to notify systemd of correct start #6991

Open MechMK1 opened 1 month ago

MechMK1 commented 1 month ago

What is the issue?

I'm running Ubuntu 24.04 with transmission 4.0.5-1build5. When installing transmission-daemon, it gets stuck at

Created symlink /etc/systemd/system/multi-user.target.wants/transmission-daemon.service → /usr/lib/systemd/system/transmission-daemon.service.

What happens is that systemd tries (and succeeds) to start transmission-daemon and it successfully responds to queries by transmission-remote. However, after 90 seconds, transmission-daemon is killed again by systemd, stating that it supposedly "timed out".

Here is the full status log:

mechmk1@server:~$ systemctl status transmission-daemon.service
× transmission-daemon.service - Transmission BitTorrent Daemon
     Loaded: loaded (/usr/lib/systemd/system/transmission-daemon.service; enabled; preset: enabled)
     Active: failed (Result: timeout) since Fri 2024-07-12 12:14:34 CEST; 11s ago
    Process: 2832 ExecStart=/usr/bin/transmission-daemon -f --log-level=error (code=exited, status=0/SUCCESS)
   Main PID: 2832 (code=exited, status=0/SUCCESS)
        CPU: 154ms

Jul 12 12:13:04 server systemd[1]: Starting transmission-daemon.service - Transmission BitTorrent Daemon...
Jul 12 12:14:34 server systemd[1]: transmission-daemon.service: start operation timed out. Terminating.
Jul 12 12:14:34 server transmission-daemon[2832]: Closing transmission session... done.
Jul 12 12:14:34 server systemd[1]: transmission-daemon.service: Failed with result 'timeout'.
Jul 12 12:14:34 server systemd[1]: Failed to start transmission-daemon.service - Transmission BitTorrent Daemon.

Restarting transmission-daemon results in the restart command hanging for 90 seconds, transmission-daemon being available for 90 seconds, and then systemd killing transmission-daemon, thinking that it's failed to start

When I use sudo -u debian-transmission transmission-daemon -f, the application runs fine. I believe somehow transmission-daemon fails to notify systemd that it has started correctly

Which application of Transmission?

transmission-daemon

Which version of Transmission?

4.0.5-1build5

mapelo commented 1 month ago

Change in /etc/systemd/system/multi-user.target.wants/transmission-daemon.service

Type=notify to Type=simple

MechMK1 commented 1 month ago

Change in /etc/systemd/system/multi-user.target.wants/transmission-daemon.service

Type=notify to Type=simple

While this is indeed a workaround, it still doesn't fix the underlying bug of no notification being sent. I'm trying to find out if this is a problem with transmission itself or ubuntu's packaged version of transmission

tearfur commented 1 month ago

Most likely the Ubuntu package maintainer didn't build with -DWITH_SYSTEMD=ON. systemd notification has always been working fine for me.

almightiest commented 1 month ago

Could apparmor be blocking it? What does sudo dmesg | grep transmission show?

You could also, at your own risk, try transmission 4.0.6 from here

uhertlein commented 1 month ago

FYI:

alyssonnaide commented 1 month ago

I get the same problem, but the daemon stop working after some dependency update, i believe it is the dependency libsystemd0.

MechMK1 commented 1 month ago

FYI:

* I've got the same issue (Kubuntu 24.04, transmission 4.0.5-1build5)

* the `Type=simple` work-around works for me

* there are no indications in `dmesg` that anything transmission-related is denied/blocked by apparmor

* 4.0.6 from "ppa:ubuntuhandbook1/transmission" has the same behaviour, i.e. it blocks for 90s and then fails; work-around works

Interestingly, if I compile transmission-daemon 4.0.6 with libsystemd-dev installed, it works as normal. ldd reveals that both my self-compiled binary and the one installed via apt link against libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0

In short: I have no idea why the packaged version doesn't work correctly

magecu commented 1 month ago

I'm having the same issue. Like wise Type=simple seams to solve it. Before the change to simple I could see apparmor lines in syslog with "w" denied on run/systemd/notify

alyssonnaide commented 1 month ago

I'm having the same issue. Like wise Type=simple seams to solve it. Before the change to simple I could see apparmor lines in syslog with "w" denied on run/systemd/notify

Change in /etc/systemd/system/multi-user.target.wants/transmission-daemon.service

Type=notify to Type=simple

I made that change, after that i update the system and de transmission-daemon run normally so far.

innovara commented 1 month ago

I changed Type=notify to Type=simple and it works but I'd recommend to use systemctl edit --full transmission-daemon.service to edit the service file

neoteknic commented 1 month ago

same bug, updated to 40.6 have handbook1 ppa , ubuntu server 24.04, bug happened about 1 week ago. fix by changing to type=simple ubuntu update broke something ?

DanyChrys commented 1 month ago

yeah work again with this simple modification "type=simple" - use this command to modify: sudo nano /lib/systemd/system/transmission-daemon.service in this location "/etc/systemd/system/multi-user.target.wants/transmission-daemon.service" is the shortcut

ElizarovEugene commented 3 weeks ago

Today after updating the system I encountered the same problem on 4.0.6. But "type=simple" doesn't help