Mailinglist Archive: opensuse (2700 mails)

< Previous Next >
Example of rc.local for Suse
Hi. I was missing a rc.local (as in redhat/fedora) in order to launch
some programs/daemons AFTER the whole system has booted. I found
"/etc/init.d/boot.local", but there we can read:

# /etc/rc.d/boot.local
#
# Here you should add things, that should happen directly
# after booting before we're going to the first run level.

This is, things are launched BEFORE going into the first runlevel. In
fedora's rc.local, things are launched AFTER the system has booted:

# /etc/rc.d/rc.local
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

Well, I've made a script that simulates Fedora's rc.local. I show it
since it can be useful for many people. It would be nice if Suse guys
include something similar into next releases of Suse.

Steps to simulate rc.local in Suse:


1) Create a "/etc/rc.d/rclocal" script, with this content:

----------------------------
#! /bin/sh


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

### BEGIN INIT INFO
# 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)
### END INIT INFO

## Execute ony when service is started
case "$1" in
start)
## commands will be executed
;;
*)
exit 0
;;
esac


# vvvvv Add your commands bellow this line vvvvv
----------------------------

2) Add executable permision: chmod +x rclocal

3) Create symlink to make it easy to find: ln -s rclocal rc.local

4) Activate the service by using yast2:
yast2 > System > Runlevel editor > rclocal > Enable


You can add/remove commands to /etc/rc.d/rc.local anytime you wish.



< Previous Next >
Follow Ups