These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX03/Kernel Protocol Switches At Boot

Classnotes | UNIX03 | RecentChanges | Preferences

You are running Debian. In order to add a file to run at boot under Debian, you must add a script to /etc/rcS.d .

Inside rcS.d, there is a README file which describes its usage:

The scripts in this directory are executed when booting the system. They are executed even when going into single user mode. The files are all symbolic links, the real files are located in /etc/init.d/ For a more general discussion of this technique, see /etc/init.d/README.

The following sequence points are defined at this time:

    • After the S40 scripts have executed, all local file systems are mounted and networking is available. All device drivers have been initialized.

    • After the S60 scripts have executed, the system clock has been set, NFS filesystems have been mounted (unless the system depends on the automounter, which is started later) and the filesystems have been cleaned.

In your favorite editor, create a script calling it "kernprot.sh" and saving it in /etc/init.d . This script will be a bash shell script, which, if you recall from the first course, you must start off with the following header telling the system how to execute it:

 #! /bin/sh

Add the commands to turn off ICMP broadcast replies and cause the kernel to ignore all ICMP echo requests to this script. Before each command, have the script echo a line telling what is about to happen. For example,

 echo -n "Ignoring ICMP broadcast replies"

and

 echo -n "Ignoring ICMP echo requests"

Then symlink this file back into rcS.d as S99kernprot.

Reboot your machine and verify that the settings stayed.



Classnotes | UNIX03 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited May 31, 2003 3:26 am (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.