|
Ni olvido ni perdón - Margarita Nelken.
|
As the init man page states, init is the father of all processes. Its primary role is to create processes by parsing /etc/inittab and running scripts in /etc/rc.d according to either a default or desired runlevel. Each script can start or stop a service, such as a networking, mail, news, or Web service. In general, the scripts under /etc/rc.d/init.d are designed to respond to commands of the following form :
script { start | stop | status | restart }
as apache (http server), or inetd (internet super server),
but providing its name without parameters shall display the allowed options, as
[sebas@mitp init.d] inetd
Usage: inetd {start|stop|status|restart|reload}
Caution : some commands require a special SIG to perform certain actions,
as inetd.
killall -1 inetd sends a SIGHUP signal to inetd to re-read
its configuration file.
One of the most important scripts in
/etc/inittab
is
rc.sysinit,
the system initialization script.
Here you can find the
"Welcome to
Red Hat Linux" message.
It also does :
After the rc.sysinit is run by init, init runs rc.local.
The next init task is to run the scripts for each runlevel. The real scripts are placed under /etc/rc.d/init.d directory, and symbolic links are set in /etc/rc.d/rcN.d directory, where "N" is the runlevel. The symbolic links are numbered to run in the proper order and to start or stop services that might be interdependent.
0 used to halt the system 1 single user mode 2 multiuser, without NFS 3 full multiuser mode 4 unused 5 X11 6 used to reboot the system
[8.2] /sbin/init uses configuration in /etc/inittab.
# The default runlevel is defined here id:5:initdefault: # First script to be executed, if not booting in emergency (-b) mode si::bootwait:/etc/init.d/boot # /etc/init.d/rc takes care of runlevel handling l0:0:wait:/etc/init.d/rc 0 l1:1:wait:/etc/init.d/rc 1 l2:2:wait:/etc/init.d/rc 2 l3:3:wait:/etc/init.d/rc 3 #l4:4:wait:/etc/init.d/rc 4 l5:5:wait:/etc/init.d/rc 5 l6:6:wait:/etc/init.d/rc 6 # what to do in single-user mode ls:S:wait:/etc/init.d/rc S ~~:S:respawn:/sbin/sulogin
linux8.2:/etc/init.d/boot.d # dir S01boot.proc -> ../boot.proc S01setserial -> ../setserial S02boot.md -> ../boot.md S03boot.lvm -> ../boot.lvm S04boot.localfs -> ../boot.localfs S05boot.crypto -> ../boot.crypto S05boot.loadmodules -> ../boot.loadmodules S05boot.scpm -> ../boot.scpm S06boot.idedma -> ../boot.idedma S06boot.restore_permissions -> ../boot.restore_permissions S06boot.swap -> ../boot.swap S07boot.clock -> ../boot.clock S08boot.quota -> ../boot.quota S09boot.ldconfig -> ../boot.ldconfig S10boot.isapnp -> ../boot.isapnp S10boot.localnet -> ../boot.localnet S11boot.ipconfig -> ../boot.ipconfig S11boot.klog -> ../boot.klog
To start a new service, start with /etc/init.d/skeleton and use insserv !
0 halt 1 single user 2 no remote networking 3 with network 4 unused 5 network + xdm 6 reboot
S20halt -> ../halt
K01single -> ../single K09splash -> ../splash S12kbd -> ../kbd S12splash -> ../splash S20single -> ../single
K01single -> ../single K09splash -> ../splash K10fbset -> ../fbset K14hotplug -> ../hotplug S07hotplug -> ../hotplug S11fbset -> ../fbset S12kbd -> ../kbd S12splash -> ../splash S20single -> ../single
K08hwscan -> ../hwscan K09splash -> ../splash K09splash_late -> ../splash_late K10cron -> ../cron K10fbset -> ../fbset K11smpppd -> ../smpppd K12splash_early -> ../splash_early K13resmgr -> ../resmgr K14hotplug -> ../hotplug K15syslog -> ../syslog K16network -> ../network K20alsasound -> ../alsasound K20atd -> ../atd K20isdn -> ../isdn K20random -> ../random K20rpmconfigcheck -> ../rpmconfigcheck S01alsasound -> ../alsasound S01atd -> ../atd S01isdn -> ../isdn S01random -> ../random S01rpmconfigcheck -> ../rpmconfigcheck S05network -> ../network S06syslog -> ../syslog S07hotplug -> ../hotplug S08resmgr -> ../resmgr S09splash_early -> ../splash_early S10smpppd -> ../smpppd S11cron -> ../cron S11fbset -> ../fbset S12kbd -> ../kbd S12splash -> ../splash S12splash_late -> ../splash_late S13hwscan -> ../hwscan
K08hwscan -> ../hwscan K09splash -> ../splash K09splash_late -> ../splash_late K10cron -> ../cron K10fbset -> ../fbset K11nscd -> ../nscd K11postfix -> ../postfix K11smpppd -> ../smpppd K12portmap -> ../portmap K12smbfs -> ../smbfs K12splash_early -> ../splash_early K12sshd -> ../sshd K13resmgr -> ../resmgr K14hotplug -> ../hotplug K15syslog -> ../syslog K16network -> ../network K20alsasound -> ../alsasound K20atd -> ../atd K20isdn -> ../isdn K20random -> ../random K20rpmconfigcheck -> ../rpmconfigcheck S01alsasound -> ../alsasound S01atd -> ../atd S01isdn -> ../isdn S01random -> ../random S01rpmconfigcheck -> ../rpmconfigcheck S05network -> ../network S06syslog -> ../syslog S07hotplug -> ../hotplug S08resmgr -> ../resmgr S09portmap -> ../portmap S09smbfs -> ../smbfs S09splash_early -> ../splash_early S09sshd -> ../sshd S10nscd -> ../nscd S10postfix -> ../postfix S10smpppd -> ../smpppd S11cron -> ../cron S11fbset -> ../fbset S12kbd -> ../kbd S12splash -> ../splash S12splash_late -> ../splash_late S13hwscan -> ../hwscan
< empty >
K07xdm -> ../xdm K08hwscan -> ../hwscan K09splash -> ../splash K09splash_late -> ../splash_late K10cron -> ../cron K10fbset -> ../fbset K11nscd -> ../nscd K11postfix -> ../postfix K11smpppd -> ../smpppd K12portmap -> ../portmap K12smbfs -> ../smbfs K12splash_early -> ../splash_early K12sshd -> ../sshd K13resmgr -> ../resmgr K14hotplug -> ../hotplug K15syslog -> ../syslog K16network -> ../network K20alsasound -> ../alsasound K20atd -> ../atd K20isdn -> ../isdn K20random -> ../random K20rpmconfigcheck -> ../rpmconfigcheck S01alsasound -> ../alsasound S01atd -> ../atd S01isdn -> ../isdn S01random -> ../random S01rpmconfigcheck -> ../rpmconfigcheck S05network -> ../network S06syslog -> ../syslog S07hotplug -> ../hotplug S08resmgr -> ../resmgr S09portmap -> ../portmap S09smbfs -> ../smbfs S09splash_early -> ../splash_early S09sshd -> ../sshd S10nscd -> ../nscd S10postfix -> ../postfix S10smpppd -> ../smpppd S11cron -> ../cron S11fbset -> ../fbset S12kbd -> ../kbd S12splash -> ../splash S12splash_late -> ../splash_late S13hwscan -> ../hwscan S14xdm -> ../xdm S90apache2 -> ../apache2
S20reboot -> ../reboot
First of all, we find /etc/rcN.d, with N in [0..6, S]. Also, there is inittab !
# /etc/inittab: init(8) configuration. # $Id: inittab,v 1.8 1998/05/10 10:37:50 miquels Exp $ # The default runlevel. id:2:initdefault: # Boot-time system configuration/initialization script. # This is run first except when booting in emergency (-b) mode. si::sysinit:/etc/init.d/rcS
0 halt 1 single user 2-5 multiuser 6 reboot
K11cron -> ../init.d/cron K12kerneld -> ../init.d/kerneld K14ppp -> ../init.d/ppp K20inetd -> ../init.d/inetd K20logoutd -> ../init.d/logoutd K20makedev -> ../init.d/makedev K20samba -> ../init.d/samba K20ssh -> ../init.d/ssh K25hwclock.sh -> ../init.d/hwclock.sh K30setserial -> ../init.d/setserial K89atd -> ../init.d/atd K90sysklogd -> ../init.d/sysklogd S10portmap -> ../init.d/portmap S20sendsigs -> ../init.d/sendsigs S30urandom -> ../init.d/urandom S31umountnfs.sh -> ../init.d/umountnfs.sh S35networking -> ../init.d/networking S40umountfs -> ../init.d/umountfs S90halt -> ../init.d/halt
S05keymaps-lct.sh -> ../init.d/keymaps-lct.sh S10checkroot.sh -> ../init.d/checkroot.sh S15isapnp -> ../init.d/isapnp S20modutils -> ../init.d/modutils S30checkfs.sh -> ../init.d/checkfs.sh S30procps.sh -> ../init.d/procps.sh S30setserial -> ../init.d/setserial S35devpts.sh -> ../init.d/devpts.sh S35mountall.sh -> ../init.d/mountall.sh S39dns-clean -> ../init.d/dns-clean S40hostname.sh -> ../init.d/hostname.sh S40networking -> ../init.d/networking S40pump -> ../init.d/pump S41portmap -> ../init.d/portmap S45mountnfs.sh -> ../init.d/mountnfs.sh S48console-screen.sh -> ../init.d/console-screen.sh S50hwclock.sh -> ../init.d/hwclock.sh S55bootmisc.sh -> ../init.d/bootmisc.sh S55urandom -> ../init.d/urandom S70nviboot -> ../init.d/nviboot
K11cron -> ../init.d/cron K12kerneld -> ../init.d/kerneld K14ppp -> ../init.d/ppp K20inetd -> ../init.d/inetd K20logoutd -> ../init.d/logoutd K20makedev -> ../init.d/makedev K20samba -> ../init.d/samba K20ssh -> ../init.d/ssh K89atd -> ../init.d/atd K90sysklogd -> ../init.d/sysklogd S20single -> ../init.d/single
S10sysklogd -> ../init.d/sysklogd S12kerneld -> ../init.d/kerneld S14ppp -> ../init.d/ppp S20inetd -> ../init.d/inetd S20logoutd -> ../init.d/logoutd S20makedev -> ../init.d/makedev S20samba -> ../init.d/samba S20ssh -> ../init.d/ssh S89atd -> ../init.d/atd S89cron -> ../init.d/cron S99rmnologin -> ../init.d/rmnologin
3 i 4 i 5 : IGUALS !
K11cron -> ../init.d/cron K12kerneld -> ../init.d/kerneld K14ppp -> ../init.d/ppp K20inetd -> ../init.d/inetd K20logoutd -> ../init.d/logoutd K20makedev -> ../init.d/makedev K20samba -> ../init.d/samba K20ssh -> ../init.d/ssh K25hwclock.sh -> ../init.d/hwclock.sh K30setserial -> ../init.d/setserial K89atd -> ../init.d/atd K90sysklogd -> ../init.d/sysklogd S10portmap -> ../init.d/portmap S20sendsigs -> ../init.d/sendsigs S30urandom -> ../init.d/urandom S31umountnfs.sh -> ../init.d/umountnfs.sh S35networking -> ../init.d/networking S40umountfs -> ../init.d/umountfs S90reboot -> ../init.d/reboot
/etc/init.d/rc5.d/S16xdm -> /etc/init.d/xdm
/etc/init.d/xdm has "SAGSAG+++" message, found in /var/log/boot.msg if /etc/inittab contains id:5:initdefault:
/etc/rc2.d/S99gdm -> /etc/init.d/gdm
MYSON Surecom EP-320X-S 100/10 M Ethernet PCI Adapter
02.0c.0 Ethernet controller: MYSON Technology Inc. Surecom EP-320X-S 100/10 M Ethernet PCI Adapter.
Subsystem: MYSON Technology Inc. Surecom EP-320X-S 100/10 M Ethernet PCI Adapter.
Flags: Bus master, medium devsel, latency 32, IRQ 9.
I/O ports at D800 [size=256]
Memory at FF.9F.F8.00 (32-bit, non-prefetchable) [size=1k]
Expansion ROM at FF.9E.00.00 [disabled] [size=64k]
Capabilities: [88] Power Management version 2.
alias eth0 fealnx
rigth after include /etc/modules.conf.local,
in "aliases - specify your hardware".
BOOTPROTO='static'
MTU=''
REMOTE_IPADDR=''
UNIQUE='60go.2q-DfY425t8'
WIRELESS='no'
BROADCAST='192.168.0.255'
IPADDR='192.168.0.1'
NETMASK='255.255.255.0'
NETWORK='192.168.0.0'
fealnx 10672 1
mii 2304 0 [fealnx]
que el podem trobar a
device "tulip_cb"
class "network" module "cb_enabler", "tulip_cb"
and also
card "IBM 10/100 EtherJet CardBus"
manfid 0x00a4, 0x0113
bind "tulip"
alias eth-pcmcia-0 xircom_cb
A /etc/init.d/networking tinc "+++ SAGSAG +++",
que no surt enlloc de /var/log.
Raó : no s'engega la xarxa : ifconfig -a
Només es a L0 i L6 ( i surt en pantalla el missatge, al
engegar o parar la màquina ).
Si donc ifconfig eth0 1.2.3.4 netmask 255.255.255.0 broadcast 1.2.3.255,
diu no existe tal dispositivo.
On es el YAST2 ???
/etc/init.d/networking uses /etc/network/interfaces Abans hi tenia
auto lo iface lo inet loopback
lspci -v output is
02.0c.0 Ethernet controller: MYSON Technology Inc. Unknown device 0803.
Trobo que tinc [Linex + P4]
/lib/modules/2.4.20/kernel/drivers/net/fealnx.o
Acció :
fealnx 10504 0 (unused)
mii 2224 0 [fealnx]
fealnx 10504 1
mii 2224 0 [fealnx]
Fix :
iface eth0 inet static address 192.168.0.1 network 192.168.0.0 netmask 255.255.255.0
fealnx
Debian net cfg Albert P4 /etc/modules.conf alias eth0 fealnx /etc/modules pcnet32 fealnx (got [1]) /etc/network/interfaces iface eth0 inet dhcp iface eth0 inet static (got [2])
Modules are loadable device drivers.
Who uses /etc/modules ?
Andreas at Google groups says :
Modules from /etc/modules are loaded by /etc/init.d/modutils
script using the modprobe command.
During boot, it is executed through the symlink /etc/rcS.d/S20modutils
Other tools to use :
modconf [Debian],
ethtool,
mii-diag
[.],
mii-tool
Franzis [9.137.152.233] /var/log/kern.log [last lines]
franzis kernel: pcnet32.c: PCI bios is present, checking for devices... franzis kernel: PCI Master Bit has not been set. Setting... franzis kernel: Found PCnet/PCI at 0x1080, irq 11. franzis kernel: eth0: PCnet/PCI II 79C970A at 0x1080, 00 50 56 66 32 d9 assigned IRQ 11. franzis kernel: pcnet32.c:v1.25kf 26.9.1999 tsbogend@alpha.franken.de franzis kernel: PCI Master Bit has not been set. Setting... franzis kernel: Found PCnet/PCI at 0x10a0, irq 10. franzis kernel: eth1: PCnet/PCI II 79C970A at 0x10a0, 00 50 56 66 32 da assigned IRQ 10. franzis kernel: pcnet32.c:v1.25kf 26.9.1999 tsbogend@alpha.franken.de
Types of shells in Bash [Suse 8.2] :
X11 + Suse 8.2 :
| SuSE 8.2 | Linex | |
|---|---|---|
| inittab | id:5:initdefault
ls:S:wait:/etc/init.d/rc S si::bootwait:/etc/init.d/boot | id:2:initdefault
~~:S:wait:/sbin/sulogin si::sysinit:/etc/init.d/rcS |
| boot scripts | /etc/init.d/rc | /etc/init.d/rc & rcS |
| scripts | /etc/init.d | /etc/init.d |
| local boot scripts | /etc/init.d/boot.local | /etc/init.d/rc.boot ? |
| init.d description | /etc/init.d/README | /usr/share/doc/sysvinit/README |
| 1st script on system startup si in inittab |
/etc/init.d/boot
starts all scripts in /etc/init.d/boot.d/* gives control to /etc/init.d/boot.local | /etc/init.s/rcS
starts all scripts in /etc/rcS.d/* gives control to /etc/init.d/rc "2" starts all scripts in /etc/rc2.d/* |
| net cfg [IP @] | /etc/sysconfig/network/ifcfg-eth0 | /etc/network/interfaces |
| net driver | /etc/modules.conf
alias eth0 fealnx | /etc/modules
fealnx |
| +++SAGSAG+++ | /etc/init.d/apache2
boot.local halt.local network xdm { /var/log/boot.msg } | /etc/init.d/modutils
networking { < nope > } |
|
|
Site under construction. |
|
Actualitzat el 11 de Gener de 2011. |
|