[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: knoppix 6.0.1: rc script for run level 2



Hello Zvi,

On Fri, Dec 11, 2009 at 10:18:01 +0200, Zvi Vered wrote:

> I installed knoppix 6.0.1 (kernel 2.6.28.4) on a USB disk. The kernel line
> in grub contains "BOOT_IMAGE=linux 2" to launch knoppix in text mode only.
>
> In order to run a script upon entering to run level 2 I wrote a script 
> named rc2 in /etc/init.d:
>
> #!/bin/sh
> echo "Hello from knoppix"

You might want to add this:
  echo "Hello from knoppix" > /var/log/hello

So you can tell if the script was run even if the echo output scrolled
out of the terminal too fast.

> sleep 10
>
> But upon entering runlevel 2, this script is not executed.

Names of scripts in /etc/init.d do not determine in which runlevel they
should run, they must be symlinked from the actual runlevel directories.
Give your script a more descriptive name like /etc/init.d/hello,
then set a symbolic link from /etc/rc2.d to it:
  cd /etc/rc2.d
  ln -s ../init.d/hello S90hello

The name prefix "Sxx" of the symlink indicates that the script will be
called with parameter "start". The number "xx" specifies the order in which
scripts will be called. "Kxx" symlinks will call scripts with parameter
"stop".

Greetings,
  Chris
-- 
Christian Perle                                    chris AT linuxinfotag.de
010111                                              http://chris.silmor.de/
101010                          LinuxGuitarKitesBicyclesBeerPizzaRaytracing


Reply to: