Certificat | LPIC-1 |
Examen: | 102 (torneu a la resta de temes) |
Fitxers: | LPI108.2_BitacolesDelSistema.pdf (LPI108.2_BitacolesDelSistema.odp) |
Objectius: | http://www.lpi.org/eng/certification/the_lpic_program/lpic_1/exam_102_detailed_objectives |
Dipòsit SVN: | https://svn.projectes.lafarga.cat/svn/lpi/Materials/Examen_102/108.2 |
Usuari: | anonymous |
Paraula de pas: | qualsevol paraula de pas |
108.2. Bitàcoles del sistema | |
---|---|
![]() |
|
![]() |
Àrees Clau de Coneixement: |
![]() |
La següent és una llista parcial de fitxers, termes i utilitats utilitzades: |
![]() |
Apunts: LPI 108.2. Bitàcoles del sistema |
[email protected]:~$ dpkg -l |grep syslog ii rsyslog 5.8.6-1ubuntu8 reliable system and kernel logging daemon
[email protected]:~$ dpkg -L rsyslog | grep etc /etc /etc/rsyslog.d /etc/apparmor.d /etc/apparmor.d/force-complain /etc/apparmor.d/disable /etc/apparmor.d/local /etc/apparmor.d/usr.sbin.rsyslogd /etc/rsyslog.conf /etc/init /etc/init/rsyslog.conf /etc/init/dmesg.conf /etc/init.d /etc/default /etc/default/rsyslog /etc/logcheck /etc/logcheck/ignore.d.server /etc/logcheck/ignore.d.server/rsyslog /etc/logrotate.d /etc/logrotate.d/rsyslog /etc/systemd /etc/systemd/system /etc/systemd/system/multi-user.target.wants /etc/init.d/rsyslog /etc/init.d/dmesg /etc/systemd/system/multi-user.target.wants/rsyslog.service
provant una aplicació. No és recomanable activar-ho en un sistema en explotació ja que pot afectar al rendiment del sistema.són els de menys importància dels missatges d'error
Exemple de rotació
[email protected]:~$ ls -lah /var/log/syslog* -rw-r----- 1 syslog adm 98K mai 24 11:45 /var/log/syslog -rw-r----- 1 syslog adm 210K mai 24 08:12 /var/log/syslog.1 -rw-r----- 1 syslog adm 22K mai 23 09:03 /var/log/syslog.2.gz -rw-r----- 1 syslog adm 57K mai 21 11:17 /var/log/syslog.3.gz -rw-r----- 1 syslog adm 80K mai 15 09:39 /var/log/syslog.4.gz -rw-r----- 1 syslog adm 60K mai 11 09:27 /var/log/syslog.5.gz -rw-r----- 1 syslog adm 44K mai 10 08:17 /var/log/syslog.6.gz -rw-r----- 1 syslog adm 103K mai 9 08:49 /var/log/syslog.7.gz
[email protected]:~$ dpkg -L logrotate /. /usr /usr/sbin /usr/sbin/logrotate /usr/share /usr/share/man /usr/share/man/man8 /usr/share/man/man8/logrotate.8.gz /usr/share/bug /usr/share/bug/logrotate /usr/share/bug/logrotate/script /usr/share/doc /usr/share/doc/logrotate /usr/share/doc/logrotate/README.Debian /usr/share/doc/logrotate/copyright /usr/share/doc/logrotate/changelog.Debian.gz /var /var/lib /var/lib/logrotate /etc /etc/logrotate.d /etc/logrotate.conf /etc/cron.daily /etc/cron.daily/logrotate
[email protected]:~$ cat /etc/logrotate.conf # see "man logrotate" for details # rotate log files weekly weekly
# keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # packages drop log rotation information into this directory include /etc/logrotate.d # no packages own wtmp, or btmp -- we'll rotate them here /var/log/wtmp { missingok monthly create 0664 root utmp rotate 1 } ...
[email protected]:~$ cat /etc/rsyslog.conf | grep -v '^#\|^$\|^;' $ModLoad imuxsock # provides support for local system logging $ModLoad imklog # provides kernel logging support (previously done by rklogd) $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $RepeatedMsgReduction on $FileOwner syslog $FileGroup adm $FileCreateMode 0640 $DirCreateMode 0755 $Umask 0022 $PrivDropToUser syslog $PrivDropToGroup syslog $WorkDirectory /var/spool/rsyslog $IncludeConfig /etc/rsyslog.d/*.conf
enviem un missatge amb la comanda logger
[email protected]:~$ sudo logger -i -s -p user.notice TAG Aturant el sistema
comprovem en el syslog que apareix el missatge
[email protected]:~$ tail /var/log/syslog ... May 23 13:01:30 jordi jordi[6424]: TAG Aturant el sistema