Back in the good old days of Linux/UNIX, there was a file (usually) located under “/etc/rc.local” that would, after all run-level specific processes have been started, run whatever scripts were in the rc.local file. With Fedora Linux moving away from the more traditional “sysvinit” service manager, this rc.local file no longer exists for running whatever of your own bash scripts/commands you might want to run after the run-level specific processes have been started.
Luckily, you can re-enable this functionality :-) Obviously, you’ll need to be root for this so if you’re not already, elevate yourself to the root user:-
su - root
Then you need to re-create the rc.local file with:-
chmod +x /etc/rc.local
Next, open the file for editing:-
As this is basically a bash script itself, you need to include the bash interpreter as the first line of the file.
You can now add whatever scripts or commands you like here – they will be run after everything else at your specific run-level has been started. In order for systemd to recognise and use this file, the systemd rc-local.service must be enabled.
systemctl enable rc-local.service
You can check the status of this service with:-
systemctl status rc-local.service
That’s all that’s required. Anything contained in this rc.local file will now be executed last-thing on reboot. Enjoy!