Archive for the ‘Executing Our Own Shell Script’ Category

Executing Our Own Shell Script When OS Booting in Debian

August 4, 2010 1 comment

Write a shell script.

To Open the folder with super user permission

#! /bin/sh

sudo nautilus

save the file as

Make sample file as executable

chmod a+x

Copy the file into init.d folder

sudo cp /etc/init.d/

check which is default runlevel

sudo vi /etc/inittab

# The default runlevel.

This means your default run level is 2.

Give the link to to the default run level

ln /etc/init.d/ /etc/rc2.d/S10sample

why i gave the link rc2.d, because of the default runlevel is 2 so i gave the link to rc2.d.

In S10sample ‘ S ‘ is mandatory 10 is number u can give your own number from 10 to 99

After that update rc by following code

sudo update-rc.d sample defaults

%d bloggers like this: