My co-worker asked me where was the rc.local file on his Fedora 17 server because he want to add something in it. I helped him for a while, so I think it is necessary to post the way here so that we can deal with this issue as soon as possible next time.
Enable rc-local service
# systemctl enable rc-local.service
Create the rc.local file in the /etc/rc.d directory, and make sure the first line is #!/bin/sh
# cat /etc/rc.d/rc.local
#!/bin/sh
route add -net 10.3.111.0 netmask 255.255.255.0 gw 172.16.100.2 dev eth1.11
Make the rc.local file executable
# chmod 700 /etc/rc.d/rc.local
Verify
Reboot the server to check if the rc.local executes.
Warning: unit files do not carry install information. No operation executed.
By: Anonymous on November 9, 2012
at 1:30 pm
[...] – #2013/01/28# 啟用Fedora 17的rc.local 參考: Fedora 17 enable rc.local # systemctl enable rc-local.service # cat /etc/rc.d/rc.local #!/bin/sh # [...]
By: Fedora 桌面使用紀錄 « 喝茶也喝咖啡 on February 2, 2013
at 9:15 am
I had the following error in Fedora 18 trying this method when i try to enable rc-local
The unit files have no [Install] section. They are not meant to be enabled using systemctl.
By: John on February 4, 2013
at 9:32 pm
same here!!
By: Anonymous on March 3, 2013
at 12:47 am