launch transmission-daemon as root

5,910

transmission-daemon does not use the USER variable in /etc/init.d/transmission-daemon if your system is using systemd.

systemd is telling the transmission-daemon to run as the debian-transmission user in the service file /lib/systemd/system/transmission-daemon.service.

Starting state:

deltik@box59:~$ ps -ef | grep transmission | grep -v grep
debian-+  8140     1  0 07:17 ?        00:00:00 /usr/bin/transmission-daemon -f --log-error

This is the proper way to override the service to start it under the root user:

  1. sudo systemctl edit transmission-daemon.service
  2. Add the following contents:

    [Service]
    User=root
    
  3. Save the file.

    • nano: Ctrl+x, y, Enter
    • vi/vim: Escape, :, w, q, Enter

      Note: This creates the file /etc/systemd/system/transmission-daemon.service.d/override.conf

  4. sudo systemctl daemon-reload
  5. sudo systemctl restart transmission-daemon.service

Now, transmission-daemon is running as the root user:

deltik@box59:~$ ps -ef | grep transmission | grep -v grep
root      8443     1  0 07:18 ?        00:00:00 /usr/bin/transmission-daemon -f --log-error
Share:
5,910

Related videos on Youtube

degr
Author by

degr

Working as enterprise web developer. Also I have hobby - game development. Here is two examples: http://kill-them.com/, and here http://kill-them.com/drift This is online games, and unfortunately nobody play them, because nobody know about it (except me and you).

Updated on September 18, 2022

Comments

  • degr
    degr almost 2 years

    have trouble with transmission daemon. I need to write files to external hdd, but always get Error: Permission denied

    Some guys write something about auto-mounting bug, but I can't mount it each time by hands (computer have no keyboard and screen, and there is different peoples can remove HDD and insert it back).

    Also, I try to change USER constant from deabian-transmission to pi and to root inside of /etc/init.d/transmission-daemon file, but nothing happen:

    ps -ef | grep trans
    

    display

    debian-+ 4599   1  15:52 ? 00:00:00 /usr/bin/transmission-daemon -f
    

    I'm sure that this line display transmission deamon porcess, because, it disappear after sudo service transmission-daemon stop.

    So my question is - how I can change this user to root? And yes, I'm absolutely do not take care about security risks about it.

  • degr
    degr over 7 years
    sorry man, I forgot to test it on weekend. I will do it today, and write response.
  • degr
    degr over 7 years
    thanks it work, now process started as root user, but web interface not work anymore, lol
  • degr
    degr over 7 years
    Finally I open /etc/passwd and set 0:0 to debian-transmission. Now debian-transmission is root user, and look like it work.