rc-local service enabling on centos7
In Redhat systemd is used as default init system replacing sysvinit. Under RHEL/CentOS 6 if custom scripts were supposed to run at boot time they would be placed in rc.local file. On CentOS 7 we can enable rc-local service.
# systemctl status rc-local
# touch /etc/rc.d/rc.local
# chmod u+x /etc/rc.d/rc.local
The rc.local file needs to have shebang defined in the first line or else the service fails.
# cat /etc/rc.d/rc.local
#!/bin/bash
echo hello
# sudo systemctl start rc-local
# sudo systemctl status rc-local
โ rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled)
Active: active (exited) since Thu 2018-04-05 04:05:07 IST; 2s ago
Process: 18246 ExecStart=/etc/rc.d/rc.local start (code=exited, status=0/SUCCESS)
Apr 05 04:05:07 server.sand.box systemd[1]: Starting /etc/rc.d/rc.local Compatibility...
Apr 05 04:05:07 server.sand.box rc.local[18246]: hello
Apr 05 04:05:07 server.sand.box systemd[1]: Started /etc/rc.d/rc.local Compatibility.
Related Articles
rc-local service enabling on centos7
In Redhat systemd is used as default init system replacing sysvinit. rc.local will be executed after all the init processes are started.
How to Configure XRDP in Ubuntu and Centos.
XRDP is an open source tool which allows users to access the Linux remote desktop via Windows RDP.
How We Set Up Our KVM Hypervisor: From Bare Metal to Production-Ready VM Host
Detailed walkthrough of building a dedicated KVM/libvirt hypervisor with XFS tuning, hugepages, 10GbE tuning, and automation.