Announcement

Collapse
No announcement yet.

transmission-daemon launches manually but not with systemctl

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [RESOLVED] transmission-daemon launches manually but not with systemctl

    Using Ubuntu server 20.04 and the Transmission web interface, Initially after the upgrade from 18.04 transmission-daemon would not launch.

    I suspected it was a permission issue somewhere because when I read the internet a bit I found several instances where it was mentioned that during the 20.04 upgrade, the file and folder permissions required by transmission-daemon were changed. There wasn't a lot of specific instructions on how to actually solve this. I looked at the folders and files in /etc/transmission-daemon and found several of them owned by "vpn", some by my user, and some by "debian-transmission", the later being a user created for use by transmission-daemon. The files used at run time are set with RW owner only permissions and owned by my user. I also observed the group "sticky bit" active on the folder.

    So I did the following:
    Purged the transmission specific PPA required by bionic but not by focal. This downgraded me from transmission-daemon 3.0 to 2.94.
    Tried the default setting.json and my previous version.
    I added debian-transmission to the vpn group and added my user to the debian-transmission group.
    I changed ownership/group of the files and folders in /etc/transmission-daemon to debian-transmission.
    Reverted to my previous settings,json

    I can now manually launch transmission-daemon using this command:
    Code:
    /usr/bin/transmission-daemon -f --log-error -g /etc/transmission-daemon/
    However when I attempt to launch it using systemctl, it fails with a useless message:
    Code:
    (code=exited, status=1/FAILURE)
    The whole status output:
    Code:
    smith@server:~$ sudo systemctl status transmission-daemon
    ● transmission-daemon.service - Transmission BitTorrent Daemon
        Loaded: loaded (/lib/systemd/system/transmission-daemon.service; enabled; vendor preset: enabled)
       Drop-In: /etc/systemd/system/transmission-daemon.service.d
                └─local.conf
        Active: inactive (dead) (Result: exit-code) since Tue 2022-03-29 08:42:02 EDT; 2s ago
       Process: 101550 ExecStart=/usr/bin/transmission-daemon -f --log-error -g /etc/transmission-daemon (code=exited, status=1/FAILURE)
      Main PID: 101550 (code=exited, status=1/FAILURE)
    
    Mar 29 08:42:02 server systemd[1]: Stopped Transmission BitTorrent Daemon.
    The command I'm using to launch is a duplicate of the command used by systemctl. It will actually show a status of "active" after about 8 seconds then immediately fail again and stay failed. Today I observed the files in the /etc/transmission-daemon had changed back to my user ownership and were rw for owner only again. I changed them back to rw for the group (debian-transmission) but this did not fix the systemctl issue and when I launched it manually again, the settings.json file changed back to no group access.

    I've played with the rpc username and file ownership and permissions a bit but I'm missing something, but I don't know what.

    Please Read Me

    #2
    Anything interesting in the logging? journalctl -u transmission-daemon.service
    What about running it as the user --guessing that the unit is set to use 'debian-transmission' maybe?

    I am by no means an expert in systemd, but I think it may be the service config as opposed to user permissions, per se
    systemctl cat transmission-daemon.service
    or dig up the file

    https://wiki.debian.org/Transmission

    Hopefully I have not added confusion.

    Comment


      #3
      Ahhh, you're a genius! Or at least give great hints. Remember I said some of the files were owned by the user "vpn" ? So I ran your cat command and saw this:
      Code:
      smith@server:~$ systemctl cat transmission-daemon.service  
      # /lib/systemd/system/transmission-daemon.service
      [Unit]
      Description=Transmission BitTorrent Daemon
      After=network.target
      
      [Service]
      User=debian-transmission
      Type=notify
      ExecStart=/usr/bin/transmission-daemon -f --log-error
      ExecStop=/bin/kill -s STOP $MAINPID
      ExecReload=/bin/kill -s HUP $MAINPID
      
      [Install]
      WantedBy=multi-user.target
      
      # /etc/systemd/system/transmission-daemon.service.d/local.conf
      [Unit]
      After=sys-devices-virtual-net-tun0.device
      Wants=sys-devices-virtual-net-tun0.device
      
      [Service]
      User=
      User=vpn
      Group=
      Group=vpn
      
      Type=simple
      
      ExecStart=
      ExecStart=/usr/bin/transmission-daemon -f --log-error -g /etc/transmission-daemon
      
      Restart=on-failure
      RestartSec=10
      Which revealed that /etc/systemd/system/transmission-daemon.service.d/local.conf had "vpn" as the owner and group of transmission-daemon. A bit more web searching, and I reconfigured it to use my local user instead of vpn and voilà! I have successfully d/l'd the new KDEneon ISO via transmission.

      I guess I assumed that "purge" would start my from scratch or the user configuration change the web was vague about was the "vpn" user. I manage my vpn manually so maybe the transmission devs were automating the VPN use?

      Regardless, thanks.

      Please Read Me

      Comment

      Working...
      X