First, the error message
Second, Analysis
Because RHEL 7 systemd rather than using initd running processes and restart the process, but through traditional initd run root.sh ohasd process
Third, the solution
It needs to be set in RHEL 7 in ohasd as a service, before running the script root.sh.
1. Create a service file as root
Touch /usr/lib/systemd/system/ohas.service
chmod 777 /usr/lib/systemd/system/ohas.service
Add the following to ohas.service newly created file in
vi /usr/lib/systemd/system/ohas.service
[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always
[Install]
WantedBy=multi-user.target
To run the following command as root
systemctl daemon-reload
systemctl enable ohas.service
systemctl Start ohas.service
2, verification
systemctl status ohas.service
This operation is to stop running after the root.sh script, and then run the root.sh script