Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#30080 - [transmission-cli] add systemd service file
Attached to Project:
Arch Linux
Opened by Marius (65kid) - Wednesday, 30 May 2012, 16:57 GMT
Last edited by Tom Gundersen (tomegun) - Monday, 20 August 2012, 13:58 GMT
Opened by Marius (65kid) - Wednesday, 30 May 2012, 16:57 GMT
Last edited by Tom Gundersen (tomegun) - Monday, 20 August 2012, 13:58 GMT
|
DetailsPlease add the attached systemd service file to the transmission-cli package.
This service file does not respect /etc/conf.d/transmissiond because using an environment variable for User= doesn't seem to be supported by systemd. Specifying the user via @ imho makes more sense anyway and whoever wants to edit the settings can use the web interface, edit settings.json or copy the service file to /etc/systemd/system and edit ExecStart=. upstream doesn't really seem to want to add this: https://trac.transmissionbt.com/ticket/4503 |
This task depends upon
If the answer to either of these questions is "no", then I don't think this service is correct.
I'd much rather just ship the simple transmission-daemon.service from the bugtracker you linked to. But obviously it should be renamed "transmission.service".
Let's keep things simple ;-)
anyway: no, running several transmission instances is obviously not something you would usually do and I understand that therefore using @ doesn't necessarily make sense. But how should the user be defined then? I would be fine to hardcode "User=transmission", but in that case the transmission-cli package should actually create that user, otherwise the service file wouldn't work out of the box. or would this not be considered a problem?
IMHO the best would be
EnvironmentFile=/etc/conf.d/transmissiond
User=$TRANS_USER
...but this doesn't work because systemd doesn't allow environment variables in User=. :(
Essentially I think it would make the most sense if the package create a transmission:transmission (system)user/group, create the correct dir in /var/lib with the correct permissions and if nothing else is configured start transmission as this user.
If you want to use a regular user, I guess you might as well run transmission from your user session, or make a copy of the service file an configure it as you want. However, by default I think we should just have a simple service that does something sensible without further configuration.
We'll see what upstream has to say though...
Tom's suggestions on the bugtracker look good to me, there is just still the question left if Type=Forking is better for transmission. As far as I can see, Type=Simple would be fine, since I can't imagine any service wanting to know when transmission is ready. But I would be fine either way, that decision is up to you.
ioni: if you want I could make a suggestion for a package change.
It would mean:
1) add a "transmission" user, with home dir /var/lib/transmission
2) add systemd service file
3) add tmpfile fragment to be able to store the pidfile as non-root
4) simplify the rc script accordingly (optional)
2. not sure if I found a bug in systemd here: I can't override transmission.service. even after a "systemctl daemon-reload" it still uses the service file from /usr/lib. If I however delete the symlink /usr/lib/systemd/system/transmissionD.service OR override transmissionD.service as well, it works. Can you confirm this?
3. I noticed that I can't simply edit User= because then transmission fails to create the pid file. What's the best way to deal with this? Change the pid location to /run/user/... ?
1) good point, i (obviously) already had this, so didn't notice that it was not created. I'll change this and push a new package.
2) this is something we should look into (irrespective of transmission)
3) good question. i think /run/user is not correct, as that is only created when you log in, whereas this is a system service. I think the safest thing to do is to change the owner of /run/transmission (in /usr/lib/tmpfiles.d/transmission.conf).
I already rebuilt and pushed the package with a comment (before reading your latest comment here), not exactly what you suggested, but hopefully will point people in the right direction.
If transmission had been socket activated, then a socket would be opened by systemd during very early boot so to userspace it appears as if transmission is "always running", so no need to wait for it at all. You'd still be able to always start transmission on boot as now, the only difference would be that we no longer need any ordering dependencies.
I don't really know all the usecases of transmission, so it might be that we could just drop the pidfile stuff straight away as no one cares when transmission is "up and ready".
Let's see what upstream has to say. But I guess the talks with them could take a while thanks to their awesome reviewing system. ;)
anyway, overriding both the service file and the tmpfile seems to work fine.
You can close this ticket if you want, thanks. :)