Skip to content

Commit

Permalink
Merge pull request #1454 from hzhhong/invalid_sysctl
Browse files Browse the repository at this point in the history
fixed #1453 : invalid syntax of /etc/sysctl.conf after executing init os script
  • Loading branch information
ks-ci-bot authored Aug 22, 2022
2 parents d6c6396 + fbd73b6 commit 25fb631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/bootstrap/os/templates/init_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ sed -r -i "s@#{0,}?vm.swappiness ?= ?([0-9]{1,})@vm.swappiness = 1@g" /etc/sysc
sed -r -i "s@#{0,}?fs.inotify.max_user_instances ?= ?([0-9]{1,})@fs.inotify.max_user_instances = 524288@g" /etc/sysctl.conf
sed -r -i "s@#{0,}?kernel.pid_max ?= ?([0-9]{1,})@kernel.pid_max = 65535@g" /etc/sysctl.conf
awk ' !x[$0]++{print > "/etc/sysctl.conf"}' /etc/sysctl.conf
tmpfile="$$.tmp"
awk ' !x[$0]++{print > "'$tmpfile'"}' /etc/sysctl.conf
mv $tmpfile /etc/sysctl.conf
systemctl stop firewalld 1>/dev/null 2>/dev/null
systemctl disable firewalld 1>/dev/null 2>/dev/null
Expand Down

0 comments on commit 25fb631

Please sign in to comment.