mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-12 11:55:28 +08:00
bugfix(CLI): generate the 'worker_cpu_affinity' config for Linux OS (#1658)
Fix #1657
This commit is contained in:
parent
d780f7406f
commit
4b47391a6c
@ -73,6 +73,18 @@ done
|
||||
sed -i '/dns_resolver:/,+4s/^#//' conf/config.yaml
|
||||
echo "passed: system nameserver imported"
|
||||
|
||||
# check whether the 'worker_cpu_affinity' is in nginx.conf .
|
||||
|
||||
make init
|
||||
|
||||
grep -E "worker_cpu_affinity" conf/nginx.conf > /dev/null
|
||||
if [ ! $? -eq 0 ]; then
|
||||
echo "failed: nginx.conf file is missing worker_cpu_affinity configuration"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "passed: nginx.conf file contains worker_cpu_affinity configuration"
|
||||
|
||||
# check admin https enabled
|
||||
|
||||
sed -i 's/\# port_admin: 9180/port_admin: 9180/' conf/config.yaml
|
||||
|
@ -21,6 +21,8 @@ local function trim(s)
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
-- Note: The `excute_cmd` return value will have a line break at the end,
|
||||
-- it is recommended to use the `trim` function to handle the return value.
|
||||
local function excute_cmd(cmd)
|
||||
local t, err = io.popen(cmd)
|
||||
if not t then
|
||||
@ -676,7 +678,7 @@ local function init()
|
||||
local sys_conf = {
|
||||
lua_path = pkg_path_org,
|
||||
lua_cpath = pkg_cpath_org,
|
||||
os_name = excute_cmd("uname"),
|
||||
os_name = trim(excute_cmd("uname")),
|
||||
apisix_lua_home = apisix_home,
|
||||
with_module_status = with_module_status,
|
||||
error_log = {level = "warn"},
|
||||
|
Loading…
Reference in New Issue
Block a user