Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid syntax of /etc/sysctl.conf after executing init os script #1453

Closed
hzhhong opened this issue Aug 19, 2022 · 1 comment · Fixed by #1454
Closed

invalid syntax of /etc/sysctl.conf after executing init os script #1453

hzhhong opened this issue Aug 19, 2022 · 1 comment · Fixed by #1454
Labels
bug Something isn't working

Comments

@hzhhong
Copy link
Contributor

hzhhong commented Aug 19, 2022

What is version of KubeKey has the issue?

version.BuildInfo{Version:"2.2.1", GitCommit:"c056977c", GitTreeState:"", GoVersion:"go1.17.11"}

What is your os environment?

CentOS Linux release 7.5.1804 (Core)

KubeKey config file

No response

A clear and concise description of what happend.

invalid syntax of /etc/sysctl.conf after executing init os script
f5f9dd9d0c589b266259ab653d44dde

Relevant log output

22:03:01 CST [GreetingsModule] Greetings
...
22:03:30 CST [ConfigureOSModule] Exec init os script
22:03:44 CST stdout: [mid-ksnode3]
setenforce: SELinux is disabled
Disabled
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
kernel.sysrq = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-arptables = 1
sysctl: /etc/sysctl.conf(103): invalid syntax, continuing...

Additional information

No response

@hzhhong hzhhong added the bug Something isn't working label Aug 19, 2022
@hzhhong
Copy link
Contributor Author

hzhhong commented Aug 19, 2022

Reproduces the problem when the file size is larger than 4Kbytes. Writing to a file while you're reading it is a recipe for disaster.
awk ' !x[$0]++{print > "/etc/sysctl.conf"}' /etc/sysctl.conf

hzhhong added a commit to hzhhong/kubekey that referenced this issue Aug 19, 2022
ks-ci-bot added a commit that referenced this issue Aug 22, 2022
fixed #1453 : invalid syntax of /etc/sysctl.conf after executing init os script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant