Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of Pisa Computer Science Department System Administration Boot-shutdown Stefano Bistarelli University of Pisa Computer Science Department

Similar presentations


Presentation on theme: "University of Pisa Computer Science Department System Administration Boot-shutdown Stefano Bistarelli University of Pisa Computer Science Department"— Presentation transcript:

1 University of Pisa Computer Science Department System Administration Boot-shutdown Stefano Bistarelli University of Pisa Computer Science Department Annalina Fabrizio

2 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Outline

3 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Outline

4 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Prima Settimana 9 Introduzione W2K Installazione win2K (anche studenti) Backup Riferimenti: -Lucidi -Cap 1,2,15 libro 10 W2K registri Active Directory Gestione computer Linux -Installazione Linux Riferimenti: -Lucidi -Cap 4,5 libro -RH inst.guide 11 lab -Linux utente1 12 lab -Linux utente2

5 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Seconda settimana 15 lab 16 W2K Booting and Shutdown Disco ripristino Linux Booting and Shutdown Inst. Linux (studenti) Riferimenti: -Lucidi - fotocopie 17 W2K Utenti Linux Backup multi boot Utenti superuser Riferimenti: -Libro Cap. 7 -Lucidi - fotocopie 18 lab Esercitazioni su: Backup (N-P-F) Ripasso quanto fatto finora Domande studenti Inst. office 19 lab

6 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Booting and Shutdown - Linux powered-down halted 1. Loading UNIX into memory 2. Inizialization of the Kernel 3. Hardware probing and configuration 4. Creation of spontaneous system processes single-user execution of inizialization script multi-user operation

7 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Loading UNIX into memory Processor look for the BIOS BIOS check the system, look and test for periferal and look for booting device (disco, nastro, cdrom, rete) su disco fa partire MBR MBR cerca il boot loader (LILO in Linux) LILO controlla file di configurazione /etc/lilo.conf (vederlo) load the kernel /boot/vmlinuz-???

8 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration /etc/lilo.conf Man lilo Lilo –q (per vedere /boot/map) Boot via seriale/mode Proteggere con password boot=/dev/sda map=/boot/map install=/boot/boot.b prompt timeout=50 linear default=linux image=/boot/vmlinuz smp label=linux initrd=/boot/initrd smp.img read-only root=/dev/sda1 image=/boot/vmlinuz label=linux-up initrd=/boot/initrd img read-only root=/dev/sda1

9 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Lab:15 min Man lilo.conf Opzione utili? Compact Message=messsagefile Verbose=? Si? Aggiungerla se non ce di gia. Digitare lilo per fissare modifiche

10 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Inizialization of the Kernel and Hardware probing and configuration Kernel: test per trovare quanta memoria istallata e quanta riservarne per se. test per controllare che HW e' presente (nel kernel ci sono inseriti tutti i device che volete, e lui controlla per verificare la presenza dell'HW) configurazione dell'HW (via probing o leggendola dal device) Se HW non risponde, device e' disabilitato (se aggiungete l' HW l'O.S. non se ne accorge (non e' plug-and-play)

11 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Creation of spontaneous system processes id:5:initdefault: # System initialization. si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 … l6:6:wait:/etc/rc.d/rc 6 # Things to run in every runlevel. ud::once:/sbin/update # Trap CTRL-ALT-DELETE ca::ctrlaltdel:/sbin/shutdown -t3 -r now # When our UPS tells us power has failed, assume we have a few minutes # of power left. Schedule a shutdown for 2 minutes from now. # This does, of course, assume you have powerd installed and your # UPS connected and working correctly. pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down" # If power was restored before the shutdown kicked in, cancel it. pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled" # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 … 6:2345:respawn:/sbin/mingetty tty6 # Run xdm in runlevel 5; xdm is now a separate service x:5:respawn:/etc/X11/prefdm -nodaemon /sbin/init (legge /etc/inittab)

12 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Id:runlevel:azione:processo # Run gettys in standard runlevels 1:2345:respawn:/sbin/mingetty tty1 Runlevel 0 halted 1,s,S single-user 2 NFS 3 net 4 not used 5 Xwin 6 reboot Azione Respawn (riparte al termine dopo 5 minuti) Once (solo una volta)

13 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Inittab (continua) /etc/rc.d/sysinit.d Set the path Read in config data. Set the system clock. Start up swapping swapon –a Set the hostname hostname ${HOSTNAME} Clear mtab Enter root and /proc into mtab. Load sound modules Check filesystems chkfs Mount all other filesystems /etc/sysconfig

14 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration modalità single user - solo / montata - nessun demone attivo - possibilità di fare fsck, date,... Da boot di lilo Single emergency

15 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration initialiazation script /etc/rc* (vederli) - setting the name - setting the timezone - fsck - mountin fs - removing file from /tmp - starting daemon e net services - account e quotas - configurig network interface

16 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration daemoni cron swapper update lpd sendmail inetd comsat talkd rwhod ftpd rexecd rlogind rshd timed routed gated syslogd named nntpd

17 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration multiuser - runlevels: 0 halted 1,s,S single-user 6 reboot - inittab: initdefault 1 getty Login shell 2 xdm xterm

18 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration login /etc/nologin /etc/usertty /etc/securetty.hushlogin (quiet login) No chekmail, no motd, no last log (/var/log/lastlog) Who /var/run/utmp (userlist grafico) /var/log/wtmp (va ripulito)

19 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Shell login ~/.bash_profile ~/.profile Shell – xterm ~/.bashrc File passwd e shadow.. Con calma!!

20 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration the system does not boot - HW problem - boot device difettoso - damaged fs - kernel malconfigurato - errori in /etc/rc*

21 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration HW problem - power? - cavi? - check the light! - spengi-riaccendi - prova autodiagnostici - syslog.conf --> log non su /dev/console ma su /var/log/kernellog - chiama tecnico

22 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration altri device probem copie del kernel su piu' boot device damaged fs / damaged --> niente da fare --> reinstall boot single user, fsck kernel malconfigurato riconfigurarlo erori in rc* edit

23 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration shut-down - modifiche a /etc/rc script - reset periferiche e non piu' riconosciute (modem, printer) - un macchina unix si dovrebbe spegnere max 1 volta a settimana - se si inchioda

24 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration come fare shut-down turn-off (solo incendio/inondazione) shutdown [-t sec] [-rkhncf] time [warning-message] bloccato login (vedi anche file nologin) opzioni -r rebbot (6), -h halt (0), -k kidding, -f fastboot, -c cancel Halt (o), reboot (6), poweroff [-n] [-w] [-d] [-f] [-i] [-p] Kill the processes, execute sync, halt the CPU -n nosync, -p poweroff init 0-6,s

25 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration come fare shut-down kill [ -signal ] [ -a ] pid By sending signal TERM to init (kill –15 1 == kill -TERM 1) SHUTDOWN By sending signal KILL to init Kill –9 1

26 University of Pisa Computer Science Department dr. Stefano Bistarelli: System Administration Signals: kill –l signal SIGHUP 1 SIGINT 2 SIGQUIT 3 SIGILL 4 SIGTRAP 5 SIGABRT 6 SIGIOT 6 SIGBUS 7 SIGFPE 8 SIGKILL 9 SIGUSR1 10 SIGSEGV 11 SIGUSR2 12 SIGPIPE 13 SIGALRM 14 SIGTERM 15 SIGSTKFLT 16 SIGCHLD 17 SIGCONT 18 SIGSTOP 19 SIGTSTP 20 SIGTTIN 21 SIGTTOU 22 SIGURG 23 SIGXCPU 24 SIGXFSZ 25 SIGVTALRM 26 SIGPROF 27 SIGWINCH 28 SIGIO 29 SIGPWR 30 SIGUNUSED 31


Download ppt "University of Pisa Computer Science Department System Administration Boot-shutdown Stefano Bistarelli University of Pisa Computer Science Department"

Similar presentations


Ads by Google