From cbc1b0790dd673d57ec673c159bee8d7b4a2c22b Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Sun, 10 Apr 2022 16:24:24 +0200 Subject: [PATCH] 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 --- net/transmission/files/transmission.init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/transmission/files/transmission.init b/net/transmission/files/transmission.init index b0553425ec..0e6e043d9b 100644 --- a/net/transmission/files/transmission.init +++ b/net/transmission/files/transmission.init @@ -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" -- 2.30.2