mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 01:44:32 +04:00
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:
committed by
Hannu Nyman
parent
e04e9eda6f
commit
d047b4c050
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=syncthing
|
PKG_NAME:=syncthing
|
||||||
PKG_VERSION:=2.0.10
|
PKG_VERSION:=2.0.10
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
|
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ config syncthing 'syncthing'
|
|||||||
|
|
||||||
# 0 to match the number of CPUs (default)
|
# 0 to match the number of CPUs (default)
|
||||||
# >0 to explicitly specify concurrency
|
# >0 to explicitly specify concurrency
|
||||||
option macprocs '0'
|
option maxprocs '0'
|
||||||
|
|
||||||
# More info: https://docs.syncthing.net/users/syncthing.html
|
# More info: https://docs.syncthing.net/users/syncthing.html
|
||||||
# option db_delete_retention_interval ''
|
# option db_delete_retention_interval ''
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ config_cb() {
|
|||||||
option='log_file'
|
option='log_file'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
macprocs)
|
||||||
|
option='maxprocs'
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
eval $option="$value"
|
eval $option="$value"
|
||||||
@@ -44,7 +48,7 @@ start_service() {
|
|||||||
local log_level='INFO'
|
local log_level='INFO'
|
||||||
local log_max_old_files=7
|
local log_max_old_files=7
|
||||||
local log_max_size=1048576
|
local log_max_size=1048576
|
||||||
local macprocs=0
|
local maxprocs=0
|
||||||
local nice=0
|
local nice=0
|
||||||
local user='syncthing'
|
local user='syncthing'
|
||||||
|
|
||||||
@@ -58,16 +62,16 @@ start_service() {
|
|||||||
# A separate step to handle an upgrade use case
|
# A separate step to handle an upgrade use case
|
||||||
[ -d "$home" ] && chown -R $user:$group "$home"
|
[ -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
|
# 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
|
# Default to the number of cores in this case
|
||||||
macprocs=$(grep -c ^processor /proc/cpuinfo)
|
maxprocs=$(grep -c ^processor /proc/cpuinfo)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command "$PROG"
|
procd_set_param command "$PROG"
|
||||||
procd_set_param env GOMAXPROCS="$macprocs"
|
procd_set_param env GOMAXPROCS="$maxprocs"
|
||||||
procd_append_param command serve
|
procd_append_param command serve
|
||||||
[ -z "$db_delete_retention_interval" ] || \
|
[ -z "$db_delete_retention_interval" ] || \
|
||||||
procd_append_param command --db-delete-retention-interval="$db_delete_retention_interval"
|
procd_append_param command --db-delete-retention-interval="$db_delete_retention_interval"
|
||||||
|
|||||||
Reference in New Issue
Block a user