Page MenuHomeFreeBSD

net-p2p/qbittorrent: Add rc.d support for nox flavor
ClosedPublic

Authored by daniel.engberg.lists_pyret.net on Jan 11 2019, 12:18 AM.

Details

Summary

Add rc.d script for headless operation for nox flavor
Claim UID and GID 850

net-p2p/transmission-cli/files/transmission.in used as template

Test Plan

Tested on FreeBSD 12.0

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

yuri added inline comments.Jan 11 2019, 12:41 AM
net-p2p/qbittorrent/files/qbittorrent.in
33 ↗(On Diff #52753)

/usr/local should be based on the $PREFIX variable in all places.

net-p2p/qbittorrent/files/qbittorrent.in
33 ↗(On Diff #52753)

Hi,
Thanks for the quick review however I don't understand your intention with the change as $PREFIX is an empty variable?
This change also seems inconsistent with a handful of other ports I looked at which use a full path.

Best regards
Daniel

yuri added inline comments.Jan 11 2019, 7:54 AM
net-p2p/qbittorrent/files/qbittorrent.in
33 ↗(On Diff #52753)

Intention: it should be installable into any prefix, not only /usr/local.

Please see audio/oss/files/oss.in for an example.

Use %%PREFIX%% as suggested by maintainer

daniel.engberg.lists_pyret.net marked 2 inline comments as done.Jan 11 2019, 9:44 AM
daniel.engberg.lists_pyret.net added inline comments.
net-p2p/qbittorrent/files/qbittorrent.in
33 ↗(On Diff #52753)

I see, thanks for the pointers.

daniel.engberg.lists_pyret.net marked an inline comment as done.Jan 11 2019, 10:03 AM
mat added inline comments.Jan 11 2019, 11:04 AM
net-p2p/qbittorrent/files/qbittorrent.in
36 ↗(On Diff #52762)

Why different handling for this variable?

net-p2p/qbittorrent/files/qbittorrent.in
36 ↗(On Diff #52762)

I'm not very familiar with rc.d scripting and it's the same method transmission-cli uses. If you have a better solution please point me to a good example as I'm trying to learn.

Adjust group variable as suggested by mat
Fix typo in variable description for rc.d script
Change qbittorrent_ variables to = and use quotes where it makes sense
Remove extra_command

daniel.engberg.lists_pyret.net marked an inline comment as done.Jan 12 2019, 2:09 PM
daniel.engberg.lists_pyret.net added inline comments.
net-p2p/qbittorrent/files/qbittorrent.in
36 ↗(On Diff #52762)

Looks ok now? @mat

mat added inline comments.Jan 14 2019, 1:35 PM
net-p2p/qbittorrent/files/qbittorrent.in
34–35 ↗(On Diff #52793)

While putting a home directory in etc feels between strange and wrong, putting a directory where you download things into is clearly a very bad idea.

From hier(7):

/etc/      system configuration files and scripts
net-p2p/qbittorrent/files/qbittorrent.in
34–35 ↗(On Diff #52793)

While I agree that's pretty much where all clients saves their config, "session files etc" by default. We could override that but I'm not sure how much we want to diverge from default settings and not all paths are configurable via switches . I'm not sure if having a buch of "dummy" directories in /home is a better choice. https://github.com/qbittorrent/qBittorrent/wiki/Frequently-Asked-Questions#Where_does_qBittorrent_save_its_settings

Perhaps a better idea would be to require the user to provide a download dir and lease the rest as is?

yuri added inline comments.Jan 14 2019, 4:13 PM
net-p2p/qbittorrent/files/qbittorrent.in
34–35 ↗(On Diff #52793)

Default the download directory to /var/db/qbittorrent-nox. Install this directory by the port with the right permissions. Otherwise, this user doesn't need the home directory.

net-p2p/qbittorrent/files/qbittorrent.in
34–35 ↗(On Diff #52793)

Sorry for the late reply, you mean like this example?
https://www.freebsd.org/doc/en/books/porters-handbook/plist-cleaning.html

This revision was not accepted when it landed; it landed in state Needs Review.Jan 27 2019, 4:28 AM
Closed by commit rP491324: net-p2p/qbittorrent: Add rc.d support for nox flavor (authored by yuri, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.
yuri added a comment.Jan 27 2019, 4:29 AM

Thank you for your submission, Daniel!