Work on Systemd service unit#6806
Conversation
|
I don't use any. It is not my agenda, I don't have those systems and I have no applications for that. Most of users is going to be satisfied with auto-start. Create Windows service is not so hard, I used to do it couple of times years ago. To do SNMP and active-agent monitoring on hosts. There is a number of tools. I think I used this one: 1. Because it is in default Windows installation. And call execution as an Administrator. 2 Also there is other similar utilities: 3, 4 For other way, is to use programming languages. Like C++: main callback if binary is not service capable. |
There was a problem hiding this comment.
Since web UI port can be set via config file (and as such via web UI itself), this breaks the POLA principle.
|
You have to make changes to |
|
Ok. Understood. This can be closed. |
Why? |
|
Ok. Sorry, I'm not experienced, in pull requests workflow. I'm going to look what is going on, and how to update my pull request to full extend. |
|
'Add more commits by pushing to the master branch on Anton-Latukha/qBittorrent.' Ok 👍 |
|
Good, thank you. oops, you've done it too. Thanks! |
|
Done. Now I know, do all commits and one push in this situations. |
|
It's funny, but |
|
I going to wait on test. This service works for myself. But I am not knowledgeable how provisioning of it through code to package must happen. I know only this: configure_file(systemd/qbittorrent-nox@.service.in ${CMAKE_CURRENT_BINARY_DIR}/qbittorrent-nox@.service @ONLY)I don't know cmake or configure process, I thought it processes qbittorrent-nox.service.in to qbittorrent-nox@.service and moves ahead, and then maintainers work with those files. Sorry, I am a DevOps ) |
My bad, that was evening and two qBt copies on disk... |
|
@qbittorrent/frequent-contributors, does anybody want to review? |
|
@Anton-Latukha, please squash all your commits. |
There was a problem hiding this comment.
how about qBittorrent-nox service for user %I?
it's not a daemon anymore.
There was a problem hiding this comment.
IMO, better be explicit, pls add back Type=simple
|
@Anton-Latukha |
|
Sorry for hijacking the thread. My current approach,
|
|
@KingLucius, rebasing against master serves two purposes: you not only squash commits, but also resolve merge conflicts. So you need up-to-date master branch, |
It is possible with an isolated |
Actually, I think that is required in case of this PR. |
|
But that would disable passing parameters to the running instance. |
|
@Anton-Latukha |
bdb3b59 to
fbac98a
Compare
|
I did source build of my fork and some testing: This moments:
Fully user-based service: I have chosen to pull current one, root based, because it is more used and encountered, by me anyway. And it work-around a moment, when users start to run instances, - those port and other inconsistencies lays on the hands of OS root administrator. It is better something than nothing. User-based service going to enable for use that now available switch (%i) for port, but it going to collude then with conf file setting. Then that needs to be resolved. I have chosen a more simple solution. P.S. If that moments are going to be addressed - we can think to do multi-user qB-nox. |
|
@evsh |
There was a problem hiding this comment.
If I understand your reply correctly, qbt is not ready for multi-user usage, then this should be PrivateTmp=false for now.
There was a problem hiding this comment.
And there is a typo in commit message: w to systemd service ... ??
There was a problem hiding this comment.
PrivateTmp=true is a recommended secure option by Systemd team.
Since it doesn't interfere with work, it can be left as is.
But as you request, I'll remove it.
There was a problem hiding this comment.
There is no typo, it is intuitive vocabulary I use in commits names, in Git or on wikis.
Like:
w - for 'write'
rw - for 'rewrite'
del - for 'deletions'
add
mv - for 'move'
sec - for 'section'
subsec - for 'subsection'
and so on.
So:
add subsec "anton" in sec "Draft"
rw subsec "anton"
mv subsec "anton" to sec "Name"
w to subsec "anton" useful information about qBittorrent.
I don't know why something like this is not widely adopted, so I promote it by example.
There was a problem hiding this comment.
I don't know why something like this is not widely adopted
My reaction is exactly why and honestly this is the first time I encounter this kind of shorthand...
There was a problem hiding this comment.
this is the first time I encounter this kind of shorthand...
Actually, that shorthand is pretty standard command-line syntax for defining file access permissions, and database variables.
That being said, it does make very little sense to use it in an otherwise conventional English sentence.
There was a problem hiding this comment.
Actually, that shorthand is pretty standard command-line syntax for defining file access permissions, and database variables.
right... the shorthand usage depends on the context.
And my thoughts are clearly expressed in your second sentence.
There was a problem hiding this comment.
But as you request, I'll remove it.
It's actually a bit more complex under the hood, if PrivateTmp=true you won't be able to add torrents to qbt via cmdline easily, I'm not sure users uses this extensively or not...
also: #6806 (comment)
There was a problem hiding this comment.
I would prefer moving this line on top of User=
|
I opened a bug report:
|
rm previous systemd unit service cmake now placing new file 'qbittorrent-nox@.service.in' systemd service now "Type=simple"
|
If bug #6955 sorts-out, than probably we can use this service. Or move and do real user-service. Considering proper usage of:
So PrivateTmp - qBt-nox CLI on user-service is non an issue. |
|
@Chocobo1 Done what you being asking: set PrivateTmp=false and moved things around. |
Thanks for the information! This might be a good idea... |
|
Ok @Chocobo1. Thank you. I remind about, that all XDG Basedir variables have established fallback. For |
|
@evsh @sledgehammer999 |
|
Thank you! |
On Ubuntu qBittorrent-nox comes without service. Because service unit was in bad state.
qBittorrent-nox should provide a good service, because its purpose is to run as a daemon, or, better, a service on server.
Without service, on every restart user needs to start daemon manually, or make service by himself.
Pull request does work adding a reliable service.
Possibility to pick user:
systemctl start qbittorrent-nox@user.servicesystemctl enable qbittorrent-nox@user.serviceOn why old service removed
Old-one service unit had issues:
Type=forkingis not a proper way to build Systemd service, because Systemd loose control over that process and it's stdout (logs).Also old service on change become redundant, so it was removed.
Packaging
Maintainers know what to do in this situation.
If link /etc/systemd/system/multi-user.target.wants/qbittorrent-nox.service exists - package manager instruction need to leave that old file on hard drive. If link not exists - service was not enabled, so it is safe to remove old unit file.
If someone has it working on old service unit - it is going to continue to work.
On updates new service file is going to be added.
On new installations - only new service file is going to be added.
Placing new service file
Corresponding to systemd standards, there are no segregation on { @ : %i } feature for units, they placed just like other ones. In other words this new service file goes in the same directory as previous one. So only minor renaming in cmake was needed.