Commit b625f02c authored by alice's avatar alice 🗡
Browse files

community/qbittorrent: use supervise-daemon, rework init.d

parent e161f673
......@@ -3,7 +3,7 @@
# Maintainer: psykose <alice@ayaya.dev>
pkgname=qbittorrent
pkgver=4.4.2
pkgrel=0
pkgrel=1
pkgdesc="qBittorrent client"
url="https://www.qbittorrent.org/"
arch="all !s390x" # qt6-qttools
......@@ -85,7 +85,7 @@ nox_openrc() {
}
sha512sums="
55656fb5fd282a3ed0e703b9b47ec9733a70cf6242cae956a5b2487ef2aeb88a04bf5d37c8fa88554edf95ab0821b76ebebb53e8fc43dc5889f8c730075d6e26 qbittorrent-4.4.2.tar.gz
f856d56dc97af4349a71861624028b334a741ecf546c7782a4530ee9786c8c801b5af5297a86eaa0b0caa29f308530ab1f654300162a4a77330946a47896871f qbittorrent-nox.initd
c6bf667c5f83dd5fb147245a8088c2672f5a239ac573aa612ae90c060dd09182f2ebb6d972b85f35fd3792f1a8eaa7f6e4b56d0381441c4d9d996ba6022dbcc6 qbittorrent-nox.confd
22a0607efdc78b54f8532b905c091bc5f92fd62e601868b50a273c45ea8116f8002a81a623916c37fabd6d643ce396bb3602122d60064412c87da12753fe7600 qbittorrent-nox.initd
97f117fd28f53ce550e2eea2a81a723b4426dbb23db2086a5938f3e2b8b482846ecd87e0ec2c1ef8c268579bec96d04f771f3f3a151292668ca37e0948e27b86 qbittorrent-nox.confd
dfadae675d9a1b1262aa7d0f848e93dafeb20acff226aac5b88dd105481e9815319f2a71cdfbd46c2901cf4b283e0b14295e85e0c7a2ddfd21e43ea858c028ff link-execinfo.patch
"
......@@ -4,3 +4,4 @@
#QBITTORRENT_GROUP="qbittorrent"
#QBITTORRENT_UMASK="0022"
#QBITTORRENT_OPTS=""
#QBITTORRENT_DIRECTORY="/var/lib/qbittorrent"
......@@ -2,16 +2,25 @@
# init.d file for qbittorrent-nox.
supervisor=supervise-daemon
  • @psykose Please stop forcing supervise-daemon in init scripts! Read e.g. 49943448 commit message for more.

  • i'm aware of its issues, but when it doesn't fail spectacularly (i.e., in e.g. nginx it fails to even terminate the process..., for instance) then it works, and i prefer having it to not

    i suppose i can make it optional and pass command_foreground_opts/command_background instead, sure

    Edited by alice
  • Once again, this cannot be overridden from the conf file, which is wrong – the users should be able to choose whether use it without modifying the init file.

  • i'm not disagreeing with that part.

  • You can find many commits with message don't force supervise-daemon as an inspiration.

    I’m thinking about adding some linter check because I’m getting tired of fixing this over and over again. :(

Please register or sign in to reply
name=qbittorrent-nox
directory="${QBITTORRENT_DIRECTORY:-/var/lib/qbittorrent}"
user="${QBITTORRENT_USER:-qbittorrent}"
group="${QBITTORRENT_GROUP:-qbittorrent}"
umask="${QBITTORRENT_UMASK:-0022}"
  • Another nonsense… these SCREAMING_CASE variables are unnecessary, you can set these standard user, group and other OpenRC variables from the conf file and just redefine the defaults here (: ${user:="qbittorrent"}).

    Edited by Jakub Jirutka
  • Correction: user and group are not OpenRC variables, it’s command_user. So there’s even one more level of unnecessary indirection.

  • fixed now. note that i never wrote any of that myself initially, and just followed the same style when adding a new option

Please register or sign in to reply
command="/usr/bin/$name"
command_args="-d ${QBITTORRENT_OPTS:-}"
start_stop_daemon_args="--umask $umask --user $user:$group"
command="/usr/bin/qbittorrent-nox"
command_args="${QBITTORRENT_OPTS:-}"
command_user="$user:$group"
command_background=true
supervise_daemon_args="--umask $umask"
# raise file descriptor count
rc_ulimit="-n 50000"
depend() {
need net
after firewall
}
start_pre() {
checkpath -d -o $command_user "$directory"
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment