I want to run the following commands one after the other upon reboot of the server after I do shutdown -r now
but not sure how to do it:
getenforce
setenforce 0
systemctl start httpd.service
I’m running CentOS 7.x
Advertisement
Answer
Technically you can crontab it
sudo crontab -e
and add the line
@reboot /somewhere/myscript.sh
and put the 3 commands in the myscript.sh with the proper rights.
But it is a bad idea since you can you just make these changes permanent:
systemctl enable httpd
and
vim /etc/selinux/config
to set the SELINUX variable to permissive
This will make the configuration permanent across reboot.