transmission: add 'incomplete' and 'watch' dirs to ujail mounts

To fix the errors:

Sun Apr 10 14:19:41 2022 daemon.err transmission-daemon[29831]: [2022-04-10 14:19:41.098] watchdir Failed to open directory "/mnt/sda1/openwrt/transmission/watch" (2): No such file or directory (watchdir.c:358)

and

Sun Apr 10 14:20:18 2022 daemon.err transmission-daemon[30175]: [2022-04-10 14:20:18.641] Couldn't create "/mnt/sda1/openwrt/transmission/incomplete": Permission denied (file-posix.c:243)

References:
- https://github.com/openwrt/packages/issues/17674

Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
This commit is contained in:
Alexander Egorenkov 2022-04-10 16:24:24 +02:00 committed by Daniel Golle
parent 35e419ae14
commit cbc1b0790d
1 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,10 @@ transmission() {
config_get incomplete_dir "$cfg" 'incomplete_dir' '/var/etc/transmission'
local incomplete_dir_enabled
config_get incomplete_dir_enabled "$cfg" 'incomplete_dir_enabled' 0
local watch_dir
config_get watch_dir "$cfg" 'watch_dir' '/var/etc/transmission'
local watch_dir_enabled
config_get watch_dir_enabled "$cfg" 'watch_dir_enabled' 0
local mem_percentage
config_get mem_percentage "$cfg" 'mem_percentage' '50'
local config_overwrite
@ -164,6 +168,8 @@ transmission() {
procd_add_jail_mount_rw "$config_dir/blocklists"
procd_add_jail_mount_rw "$config_dir/stats.json"
procd_add_jail_mount_rw "$download_dir"
[ "$incomplete_dir_enabled" = "1" ] && procd_add_jail_mount_rw "$incomplete_dir"
[ "$watch_dir_enabled" = "1" ] && procd_add_jail_mount_rw "$watch_dir"
web_home="${web_home:-/usr/share/transmission/web}"
[ -d "$web_home" ] && procd_add_jail_mount "$web_home"
[ -f "$ca_bundle_file" ] && procd_add_jail_mount "$ca_bundle_file"