ottima velocità di boot: background dei processi in rc.M
Inviato: sab 5 nov 2005, 11:44
il mio pc faceva il boot del kernel 2.4 (slack 10.2) in poco più di un 1 minuto.
un tempo accettabile, ma in gran parte dedicato ad aspettare che hotplug venga eseguito.
Leggendo un po' su slacky.it e un po' su alt.os.linux.slackware ho provato a mettere in background l'esecuzione di questo processo.
A beneficio dei più inesperti, per fare questo, è necessario mettere mano al file rc.M, racchiudere tra parentesi il comando che fa partire il processo di hotplug, e farlo seguire da &.
Da quello che so, questo trucco si può applicare in pratica a tutti gli script lanciati da rc.M ma *non* a rc.inet1, altrimenti rischiate di avviare rc.inet2 senza che tutte le inizializzazioni necessarie siano state fatte.
Ad es. io ho messo in background crond, pcmcia, cups, ecc ecc.
Risultato: il tempo di boot è di 30 sec, esattamente la metà ;=)
in pratica, accedo alla shell che alcuni processi stanno ancora lavorando in bg, ma questo non pregiudica secondo me in nessun modo la funzionalità del sistema.
***//frammento preso da rc.M
-->inet1 non è mandato in background
# Initialize the networking hardware. If your network driver is a module
# and you haven't loaded it manually, this will be deferred until after
# the hotplug system loads the module below.
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi
pcmcia è invece avviato in background, così come il successivo inet2
# Initialize the hotplugging subsystem for Cardbus, IEEE1394, PCI, and USB devices:
if [ -x /etc/rc.d/rc.hotplug -a -r /proc/modules ]; then
# Don't run hotplug if 'nohotplug' was given at boot.
if ! grep nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
echo "Activating hardware detection: /etc/rc.d/rc.hotplug start"
#giorgio - backgrounding
(. /etc/rc.d/rc.hotplug start) &
fi
fi
# Start networking daemons:
if [ -x /etc/rc.d/rc.inet2 ]; then
(. /etc/rc.d/rc.inet2)&
fi
un tempo accettabile, ma in gran parte dedicato ad aspettare che hotplug venga eseguito.
Leggendo un po' su slacky.it e un po' su alt.os.linux.slackware ho provato a mettere in background l'esecuzione di questo processo.
A beneficio dei più inesperti, per fare questo, è necessario mettere mano al file rc.M, racchiudere tra parentesi il comando che fa partire il processo di hotplug, e farlo seguire da &.
Da quello che so, questo trucco si può applicare in pratica a tutti gli script lanciati da rc.M ma *non* a rc.inet1, altrimenti rischiate di avviare rc.inet2 senza che tutte le inizializzazioni necessarie siano state fatte.
Ad es. io ho messo in background crond, pcmcia, cups, ecc ecc.
Risultato: il tempo di boot è di 30 sec, esattamente la metà ;=)
in pratica, accedo alla shell che alcuni processi stanno ancora lavorando in bg, ma questo non pregiudica secondo me in nessun modo la funzionalità del sistema.
***//frammento preso da rc.M
-->inet1 non è mandato in background
# Initialize the networking hardware. If your network driver is a module
# and you haven't loaded it manually, this will be deferred until after
# the hotplug system loads the module below.
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1
fi
pcmcia è invece avviato in background, così come il successivo inet2
# Initialize the hotplugging subsystem for Cardbus, IEEE1394, PCI, and USB devices:
if [ -x /etc/rc.d/rc.hotplug -a -r /proc/modules ]; then
# Don't run hotplug if 'nohotplug' was given at boot.
if ! grep nohotplug /proc/cmdline 1> /dev/null 2> /dev/null ; then
echo "Activating hardware detection: /etc/rc.d/rc.hotplug start"
#giorgio - backgrounding
(. /etc/rc.d/rc.hotplug start) &
fi
fi
# Start networking daemons:
if [ -x /etc/rc.d/rc.inet2 ]; then
(. /etc/rc.d/rc.inet2)&
fi