11.04.2013 Views

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

Guida avanzata di scripting Bash - Portale Posta DMI

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

chkconfig<br />

tcpdump<br />

mount<br />

Capitolo 13. Coman<strong>di</strong> <strong>di</strong> sistema e d’amministrazione<br />

Verifica la configurazione <strong>di</strong> rete. Il comando elenca e gestisce i servizi <strong>di</strong> rete presenti nella<br />

<strong>di</strong>rectory /etc/rc?.d avviati durante il boot.<br />

Trattandosi dell’adattamento fatto da Red Hat Linux dell’originario comando IRIX, chkconfig<br />

potrebbe non essere presente nell’installazione <strong>di</strong> base <strong>di</strong> alcune <strong>di</strong>stribuzioni Linux.<br />

bash$ chkconfig --list<br />

atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off<br />

rwhod 0:off 1:off 2:off 3:off 4:off 5:off 6:off<br />

...<br />

“Sniffa” i pacchetti <strong>di</strong> rete. È uno strumento per analizzare e risolvere problemi <strong>di</strong> traffico sulla rete<br />

per mezzo del controllo delle intestazioni <strong>di</strong> pacchetto che verificano criteri specifici.<br />

Analizza gli ip dei pacchetti in transito tra gli host bozoville e caduceus:<br />

bash$ tcpdump ip host bozoville and caduceus<br />

Naturalmente, l’output <strong>di</strong> tcpdump può essere verificato usando alcune delle già trattate utility per<br />

l’elaborazione del testo.<br />

Filesystem<br />

Monta un filesystem, solitamente <strong>di</strong> un <strong>di</strong>spositivo esterno, come il floppy <strong>di</strong>sk o il CDROM. Il file<br />

/etc/fstab fornisce un utile elenco dei filesystem, partizioni e <strong>di</strong>spositivi <strong>di</strong>sponibili, con le<br />

relative opzioni, che possono essere montati automaticamente o manualmente. Il file /etc/mtab<br />

mostra le partizioni e i filesystem attualmente montati (compresi quelli virtuali, come /proc).<br />

mount -a monta tutti i filesystem e le partizioni elencate in /etc/fstab, ad eccezione <strong>di</strong> quelli con<br />

l’opzione noauto. Al boot uno script <strong>di</strong> avvio, presente in /etc/rc.d (rc.sysinit o qualcosa <strong>di</strong><br />

analogo), invoca questo comando per montare tutto quello che deve essere montato.<br />

mount -t iso9660 /dev/cdrom /mnt/cdrom<br />

# Monta il CDROM<br />

369

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!