Computer Tips - Fedora: run a command at boot / startup

Date: 2016aug30 Updated: 2024nov13 OS: RedHat/Fedora/CentOS Level: beginner Language: bash Q. Fedora: run a command at boot / startup A. As root, put the commands you want to run in:
/etc/rc.d/rc.local
eg:
#!/bin/sh echo system started | mail root
And make it executable:
chmod a+x rc.local
This is the way it worked before systemd and it continues to work this way with systemd (There's an rc-local.service but you don't need to mess with it).