C’est dans /etc/init.d qu’i faut mettre ce genre de scripts.
burp:/etc/init.d# pwd
/etc/init.d
burp:/etc/init.d# ls
alsa dbus-1 hotplug-net makedev nviboot scsitools-pre.sh udev-mtab
apache dirmngr hwclockfirst.sh module-init-tools portmap scsitools.sh umountfs
atd discover hwclock.sh modutils ppp sendsigs umountnfs.sh
bootclean.sh dns-clean hwtools mountall.sh pppd-dns single urandom
bootlogd exim4 ifupdown mountnfs.sh procps.sh skeleton xdebconfigurator
bootmisc.sh fam ifupdown-clean mountvirtfs rc ssh xfree86-common
checkfs.sh gdm inetd netatalk rcS stop-bootlogd xprint
checkroot.sh halt initrd-tools.sh networking README sudo
console-screen.sh hdparm kdm nfs-common reboot sysklogd
cron hostname.sh keymap.sh nfs-kernel-server rmnologin sysstat
cupsys hotplug klogd ntpdate samba udev
Ensuite, tu fais les liens correspondants dans les répertoires rc:
burp:/etc/init.d# ls -ld /etc/rc*
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc0.d
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc1.d
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc2.d
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc3.d
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc4.d
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc5.d
drwxr-xr-x 2 root root 4096 2006-03-05 14:06 ../rc6.d
drwxr-xr-x 2 root root 4096 2006-04-17 18:19 ../rcS.d
burp:/etc/init.d#
Le contenu de ces répertoires, c’est simplement des liens sur le contenu de /etc/init.d
Par exemple:
burp:/etc/rc2.d# ls -l
total 0
lrwxrwxrwx 1 root root 18 2005-12-20 16:38 S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx 1 root root 15 2005-12-20 16:38 S11klogd -> ../init.d/klogd
lrwxrwxrwx 1 root root 14 2005-12-20 19:01 S12alsa -> ../init.d/alsa
lrwxrwxrwx 1 root root 13 2005-12-20 16:38 S14ppp -> ../init.d/ppp
lrwxrwxrwx 1 root root 17 2005-12-20 18:04 S18portmap -> ../init.d/portmap
lrwxrwxrwx 1 root root 16 2005-12-20 18:05 S20cupsys -> ../init.d/cupsys
lrwxrwxrwx 1 root root 16 2005-12-20 18:04 S20dbus-1 -> ../init.d/dbus-1
lrwxrwxrwx 1 root root 17 2005-12-20 18:04 S20dirmngr -> ../init.d/dirmngr
lrwxrwxrwx 1 root root 15 2005-12-20 16:38 S20exim4 -> ../init.d/exim4
lrwxrwxrwx 1 root root 15 2005-12-20 16:38 S20inetd -> ../init.d/inetd
lrwxrwxrwx 1 root root 17 2005-12-20 16:38 S20makedev -> ../init.d/makedev
lrwxrwxrwx 1 root root 27 2005-12-20 18:04 S20nfs-kernel-server -> ../init.d/nfs-kernel-server
lrwxrwxrwx 1 root root 15 2005-12-20 18:04 S20samba -> ../init.d/samba
lrwxrwxrwx 1 root root 13 2005-12-20 18:04 S20ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 17 2005-12-23 20:14 S20sysstat -> ../init.d/sysstat
lrwxrwxrwx 1 root root 26 2005-12-20 21:17 S20xdebconfigurator -> ../init.d/xdebconfigurator
lrwxrwxrwx 1 root root 16 2005-12-20 18:53 S20xprint -> ../init.d/xprint
lrwxrwxrwx 1 root root 13 2005-12-20 18:04 S21fam -> ../init.d/fam
lrwxrwxrwx 1 root root 20 2005-12-20 18:04 S21nfs-common -> ../init.d/nfs-common
lrwxrwxrwx 1 root root 13 2005-12-20 16:38 S89atd -> ../init.d/atd
lrwxrwxrwx 1 root root 14 2005-12-20 16:38 S89cron -> ../init.d/cron
lrwxrwxrwx 1 root root 16 2005-12-24 16:48 S91apache -> ../init.d/apache
lrwxrwxrwx 1 root root 13 2005-12-20 18:06 S99gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 13 2006-03-05 14:06 S99kdm -> ../init.d/kdm
lrwxrwxrwx 1 root root 19 2005-12-20 16:38 S99rmnologin -> ../init.d/rmnologin
lrwxrwxrwx 1 root root 23 2005-12-20 16:38 S99stop-bootlogd -> ../init.d/stop-bootlogd
burp:/etc/rc2.d#
Pour faire les chose proprement, il faut utiiliser update-rc.d
Regardes la man page de update-rc.d, c’est très bien expliqué.