Thursday, January 17, 2013

rc.local script in Opensuse 11.

If you have commands and you wanted that while boot. In RHEL/CENTOS /etc/rc.d/rc.local but the same file is not exists in Opensue by default you have to create that using following steps.

Create the file  /etc/rc.d/rclocal
# file content #! /bin/sh

## This script simulates redhat's rc.local (Add commands at the end)

# Provides: rclocal
# Required-Start: $local_fs $remote_fs $network
# X-UnitedLinux-Should-Start: $ALL
# Required-Stop:
# X-UnitedLinux-Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Simulates rc.local
# Description: Simulates redhat's rc.local: contains
# commands to execute after system has booted (all services are already
# available)

## Execute ony when service is started
case "$1" in
## commands will be executed
exit 0

Do give right permission for executable using command : chmod 777 /etc/rc.d/rclocal
Create symlink if you want ln -s  /etc/rc.d/rclocal  /etc/rc.d/rc.local

You have to Enable that service in Yast2 from command prompt, using this command.

yast2 > System > Runlevel editor > rclocal > Enable
Now you can edit file  /etc/rc.d/rc.local  add your command in script at "case $1".

Reboot and check..! Its done.!


android digital signage software said...

Grateful to check out your website, I seem to be ahead to more excellent sites and I wish that you wrote more informative post for us. Well done work.

Renu said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
Devops Training in electronic city