还有一个原因极可能是:“在设置selinux的时候,是不是位置写错了,应该修改SELINUX行,而不是SELINUXTYPE”
问题:开机提示“Kernel panic - not syncing: Attempted to kill init!”
解决方案:
1、强制重启,编辑grub启动选项,按E键,选中kernel开头的行,再按E键,在最后添加enforcing=0,
2、按B键重启,
3、系统正常启动后,查看 并修改grub启动选项 cat /boot/grub/grub.conf
————————————————
版权声明:本文为CSDN博主「秋雪夜雨寒」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/longyinyushi/article/details/51000115
最后确定是selinuxtype问题,批量解决:
(延伸阅读 SELinux 宽容模式(permissive) 强制模式(enforcing) 关闭(disabled) 几种模式之间的转换 https://blog.csdn.net/tangsilian/article/details/80144112 )
批量:
ansible all_agent -m command -a
"sed -i "/^SELINUXTYPE/s/disabled/targeted/g" /etc/selinux/config"
ansible all_agent -m command -a
"sed -i "/^SELINUX/s/enforcing/disabled/g" /etc/selinux/config"
但是最后 ansible提示:[WARNING]: Consider using template or lineinfile module rather than running sed
有机会学习一下 lineinfile module 模块吧