Posted by: kezhong | October 15, 2012

Fedora 17 enable rc.local

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.


Responses

  1. Warning: unit files do not carry install information. No operation executed.

  2. […] – #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 # […]

  3. 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.

  4. same here!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: