[Linuxtrent] Re: Creazione pacchetti .deb e gestione inittab

  • From: Flavio Visentin <THe_ZiPMaN@xxxxxxxxx>
  • To: linuxtrent@xxxxxxxxxxxxx
  • Date: Mon, 18 Apr 2005 00:04:59 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| Hai intenzione di modificare /etc/inittab dai maintainer script?
|
| Hmmm...
|
| Un errore ed il sistema non viene più su... anzi forse va giù...
|
| Hmmm!!!
|
| Pensaci su altre due o tre volte.
|
| Cosa vorresti fare esattamente?
|

Lo so.

Il fatto è che devo avere un demone SEMPRE attivo in TUTTI i runlevel
(da 0..6).
Vi possono essere molti modi, ma il più semplice è quello di
aggiungere ad /etc/inittab una bella linea così:

xy:0123456:respawn:/sbin/demone

L'alternativa è quella di mettere in start il demone in tutti i
runlevel, ma in caso di problemi il demone potrebbe non avviarsi,
mentre da init il demone parte sempre, purché il root filesystem sia
accedibile in lettura (alias fallisce solo quando non trova il
filesystem).
In caso di problemi l'unica conseguenza è un bel messaggio "Respawning
too fast. Disabled for 5 minutes".

La modifica volevo fare in modo molto semplice, aggiungendo a postinst
le seguenti linee:

cp /etc/inittab /etc/inittab~
grep -v 'xy:0123456:respawn:/sbin/demone' /etc/inittab~ > /etc/inittab
echo 'xy:0123456:respawn:/sbin/demone' >> /etc/inittab
rm /etc/inittab~

Che ne dici?

- --
Flavio Visentin

|                     \|||/
|                    @/0.0\@
|                     \ - /
+------------------oOOo---oOOo------------------

There are only 10 types of people in this world:
those who understand binary, and those who don't.

GPG Key: http://www.zipman.it/gpgkey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCYt2LusUmHkh1cnoRAllmAJ9JayTl1//TaCstPiUylnSP69t/iQCfW6aD
/FHWrdEq/4LOGDFOPQ5hyrk=
=1aVY
-----END PGP SIGNATURE-----
--
Per iscriversi  (o disiscriversi), basta spedire un  messaggio con OGGETTO
"subscribe" (o "unsubscribe") a mailto:linuxtrent-request@xxxxxxxxxxxxx


Other related posts: