更新时间:2024-09-30 GMT+08:00
Linux镜像安装一键式重置密码插件启动失败怎么办?
操作场景
Linux镜像安装一键式重置密码插件启动失败,请参考本章节处理。
问题描述
用户通过执行命令sudo sh setup.sh安装一键式重置密码插件,有如下报错:
begin install CloudResetPwdAgent ===============cp LinuxCloudResetPwdAgent====================== ===============vi /etc/profile====================== ===============begin install CloudrResetPwdAgent=================== Detected RHEL or Fedora: Installing the cloudResetPwdAgent daemon using systemd... creating default service file... Reading file /etc/systemd/system/cloudResetPwdAgent.service Job for cloudResetPwdAgent.service failed because the control process exited with error code. See "systemctl status cloudResetPwdAgent.service" and "journalctl -xe" for details. Failed to start service cloudResetPwdAgent /CloudResetPwdAgent/CloudResetPwdAgent.Linux cloudResetPwdAgent install successfully.
同时/var/log/message文件中有如下报错:
systemd[1]: Starting cloudResetPwdAgent... systemd[2324]: cloudResetPwdAgent.service: Failed to execute command: Permission denied systemd[2324]: cloudResetPwdAgent.service: Failed at step EXEC spawning /CloudrResetPwdAgent/bin/./cloudResetPwdAgent.script: Permission denied systemd[1]: cloudResetPwdAgent.service: Control process exited, code=exited status=203 systemd[1]: cloudResetPwdAgent.service: Failed with result 'exit-code'. systemd[1]: Failed to start cloudResetPwdAgent.
则由于SELinux开启时,重置密码插件不能在根目录下执行,需要关闭SELinux。
处理方法
- 执行以下命令,临时关闭SELinux。
setenforce 0
- 再次执行关闭Selinux操作,确保虚拟机重启后生效。
- 执行以下命令,重新安装重置密码插件。
sudo sh setup.sh
- 如果脚本执行成功打印“cloudResetPwdAgent install successfully.”,且未打印“Failed to start service cloudResetPwdAgent”,表示安装成功。
- 否则安装失败,请检查安装环境是否符合要求,并重试安装操作。
父主题: 密码与密钥对