Monday, May 24, 2010

rc.local in Suse

Suse do not have any rc.local script..
Which this script useful is..
In RedHat, after the init start, it will invoke the command in rc.local..
It is very useful which almost same function with startup in windows..

I had do some google.. and turn out..
This link is a lot helpful..

1. create a new file named rclocal at /etc/init.d/
vi /etc/init.d/rclocal

2. Then add the the following in the beginning script..
# Provides: rclocal
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: whatever

3. Change mode for the file
chmod 755 /etc/init.d/rclocal

4. add service
chkconfig --add rclocal

Thank all..
Then add the service you need start at the end of the file.

Below is the sample rclocal file I created..

There is some reason the file I created is rclocal instead of rc.local..
In the man innserv, it does not allow files with .local in used..
The error will appear
insserv: script name rc.local is not valid, skipped!

No comments: