Which file to add systemctl startup paramaters to?

1

I am running transmission through systemctl start/stop transmission-daemon. I want to add some logging paramaters to transmission when it starts but I am not sure which file to add them to.

I have the /etc/init.d/trasnsmission-daemon script file, then I have /etc/default/transmission-daemon but that one either isn't getting hit or getting overridden since the options in there are not being used. The I have /etc/systemd/system/transmission-daemon.service.d directry with a user.conf and group.conf files in it and those seem to be being used since those are the user and group being used.

Basically I'm trying to add something like ExecStart I would have put in /etc/systemd/system/ file, but now that I have this .d directory I'm not sure what file to add those startup parameters to. I'm assuming I need a new file in the .d directory for those but not sure what the name would be. Basically I'm just looking to add --logfile and --log-debug when the service is started.

Krandor

Posted 2020-01-04T19:29:10.533

Reputation: 11

I'm getting Jan 05 01:48:43 downloader systemd[1]: transmission-daemon.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.

/etc/systemd/system/transmission-daemon.service.d# ls group.conf log.conf user.conf

root@downloader:/etc/systemd/system/transmission-daemon.service.d# cat *

[Service] Group = downloader [Service] ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /home/downloader/transmission.log

[Service] User = downloader root@downloader:/etc/systemd/system/transmission-daemon.service.d# – Krandor – 2020-01-05T02:04:08.137

I have nothing in systemd/system/transmission-daemon.service.d with an Execstart. Is something in /etc/default/transmission-daemon or /etc/init.d/transmission-daemon interferring? – Krandor – 2020-01-05T02:09:24.463

Answers

0

I believe the line you need is ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /var/log/transmission.log. Create log.conf in /etc/systemd/system/transmission-daemon.service.d and add

[Service]
ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /var/log/transmission.log

Your transmission user may not have access to write in /var/log, so you can either change the directory or:

sudo touch /var/log/transmission.log
sudo chown transmission-user:transmission-user /var/log/transmission.log
sudo chmod 644 /var/log/transmission.log

(Or change permissions to whatever you want, 644 is just an example that will allow the transmission user to write to the file, and allow your regular user to read the file.)

Bosley

Posted 2020-01-04T19:29:10.533

Reputation: 36

I can't comment on the comments under your original question without more rep, but hopefully you'll see this. The other ExecStart is most likely in the main unit file then. Usually /etc/systemd/system/transmission-daemon.service. If you find it there just add the logging options to that command and delete the log.conf drop-in in transmission-daemon.service.d. – Bosley – 2020-01-05T05:33:15.110