syncthing: fix maxprocs config option name

Map old config option "macprocs" to new one.

Signed-off-by: George Sapkin <george@sapk.in>
This commit is contained in:
George Sapkin
2025-11-01 02:38:10 +02:00
committed by Hannu Nyman
parent e04e9eda6f
commit d047b4c050
3 changed files with 11 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=syncthing
PKG_VERSION:=2.0.10
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)

View File

@@ -16,7 +16,7 @@ config syncthing 'syncthing'
# 0 to match the number of CPUs (default)
# >0 to explicitly specify concurrency
option macprocs '0'
option maxprocs '0'
# More info: https://docs.syncthing.net/users/syncthing.html
# option db_delete_retention_interval ''

View File

@@ -21,6 +21,10 @@ config_cb() {
option='log_file'
;;
macprocs)
option='maxprocs'
;;
esac
eval $option="$value"
@@ -44,7 +48,7 @@ start_service() {
local log_level='INFO'
local log_max_old_files=7
local log_max_size=1048576
local macprocs=0
local maxprocs=0
local nice=0
local user='syncthing'
@@ -58,16 +62,16 @@ start_service() {
# A separate step to handle an upgrade use case
[ -d "$home" ] && chown -R $user:$group "$home"
# Changes to "niceness"/macprocs are not picked up either by reload_config
# Changes to "niceness"/maxprocs are not picked up either by reload_config
# or by restart: the service has to be stopped/started for it to take effect
if [ $macprocs -le 0 ]; then
if [ $maxprocs -le 0 ]; then
# Default to the number of cores in this case
macprocs=$(grep -c ^processor /proc/cpuinfo)
maxprocs=$(grep -c ^processor /proc/cpuinfo)
fi
procd_open_instance
procd_set_param command "$PROG"
procd_set_param env GOMAXPROCS="$macprocs"
procd_set_param env GOMAXPROCS="$maxprocs"
procd_append_param command serve
[ -z "$db_delete_retention_interval" ] || \
procd_append_param command --db-delete-retention-interval="$db_delete_retention_interval"