본문 바로가기

ETC/자격증

[리눅스마스터]제1502회 리눅스마스터 1급 2차 시험 단답식 풀이 2

반응형

4. 다음은 RPM 패키지를 관리해주는 데이터베이스에 문제가 발생했을 때의 경우를 나타낸다. 

( 괄호 ) 안에 알맞은 내용을 적으시오.

# rpm -qi bmp
free list corrupt (42)- contact rpm-list@redhat.com
# rpm ( ① )

<조 건>
- RPM 패키지를 관리해주는 데이터베이스를 다시 작성한다.

 

rpm -qi 패키지명 : 단순히 설치된 패키지의 정보를 보는 옵션

 

[root@server1 ~]# man rpm

 

  --initdb : 데이터베이스를 생성

  --dbpath : 데이터베이스 경로 지정

  --rebuilddb: 데이터베이스를 다시 생성

 

① --rebuld

 

5. 다음은 네트워크 디바이스를 커널모듈로 로드하는 내용이다. ( 괄호 ) 안에 알맞은 내용을 적으시오.

# ( ① ) igb
# lsmod
Module Size Used by
igb 23872 1
# vi ( ② )
alias eth0 e1000

<조 건>
- 네트워크 인터페이스 모듈명은 igb이다.
- igb 모듈은 의존성을 참조하여 로드하고, 부팅 시에 자동으로 로드되게 한다.

 

modprobe : 모듈을 설치 / 삭제하는 명령어

 

[root@server1 ~]# man modprobe
DESCRIPTION
       modprobe intelligently adds or removes a module from the Linux kernel: note that for convenience, there
       is no difference between _ and - in module names (automatic underscore conversion is performed).
       modprobe looks in the module directory /lib/modules/`uname -r` for all the modules and other files,
       except for the optional configuration files in the /etc/modprobe.d directory (see modprobe.d(5)).
       modprobe will also use module options specified on the kernel command line in the form of
       <module>.<option> and blacklists in the form of modprobe.blacklist=<module>.

       Note that unlike in 2.4 series Linux kernels (which are not supported by this tool) this version of
       modprobe does not do anything to the module itself: the work of resolving symbols and understanding
       parameters is done inside the kernel. So module failure is sometimes accompanied by a kernel message:
       see dmesg(8).

       modprobe expects an up-to-date modules.dep.bin file as generated by the corresponding depmod utility
       shipped along with modprobe (see depmod(8)). This file lists what other modules each module needs (if
       any), and modprobe uses this to add or remove these dependencies automatically.

       If any arguments are given after the modulename, they are passed to the kernel (in addition to any
       options listed in the configuration file).

 

[root@server1 ~]# find / -name modprobe*
/proc/sys/kernel/modprobe
/etc/modprobe.d
/usr/sbin/modprobe
/usr/lib/modprobe.d
/usr/share/doc/alsa-lib-1.0.27.2/modprobe-dist-oss.conf
/usr/share/augeas/lenses/dist/modprobe.aug
/usr/share/man/man5/modprobe.d.5.gz
/usr/share/man/man5/modprobe.conf.5.gz
/usr/share/man/man8/modprobe.8.gz

 

① modprobe

② /etc/modprobe.conf

 

6. 다음은 새로 장착된 디스크의 정보를 fdisk 명령어를 통해 확인한 예이다. 다음 (괄호)안에 들어갈 숫자를 적으시오.

# fdisk –l
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5026 40371313+ ( ① ) Linux
/dev/sda2 5027 5157 1052257+ ( ② )
Linux swap / Solaris
/dev/sda3 5158 5221 514080 ( ③ ) Linux

 

[root@server1 ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): l

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
1e  Hidden W95 FAT1 80  Old Minix

 

① 83

② 82

③ 83

 

7. 다음 조건에 맞는 적당한 내용을 ( 괄호 )안에 적으시오.(단, 설정 파일의 일부 내용 만을 표시하였다.)

# cat /etc/( ① )
authprive.* /var/log/secure
mail.* /var/log/maillog
*.emerg *
( ② ) /var/log/warn.log

<조 건>
① : syslogd 데몬의 주 설정 파일이다.
② : 모든 메세지 종류 중 warning 이상의 레벨 메세지가 /var/log/warn.log 파일에 기록으로 남긴다.

(모든 메세지란 auth, authpriv, cron, daemon, kern, lpr, mail, mark, news, security(auth), syslog, user, uucp,
local0 ∼ local7 이다.)

 

[root@server1 ~]# find / -name *syslog*.conf
/etc/audisp/plugins.d/syslog.conf
/etc/rsyslog.conf
/usr/lib/dracut/modules.d/98syslog/rsyslog.conf
/usr/share/doc/sudo-1.8.6p7/sample.syslog.conf

 

[root@server1 ~]# vi /etc/syslog.conf
#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 :omusrmsg:*

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log

 

#define KERN_EMERG    "<0>"  /* system is unusable               */
#define KERN_ALERT    "<1>"  /* action must be taken immediately */
#define KERN_CRIT     "<2>"  /* critical conditions              */
#define KERN_ERR      "<3>"  /* error conditions                 */
#define KERN_WARNING  "<4>"  /* warning conditions               */
#define KERN_NOTICE   "<5>"  /* normal but significant condition */
#define KERN_INFO     "<6>"  /* informational                    */
#define KERN_DEBUG    "<7>"  /* debug-level messages             */

 

① syslog.conf

② *.warning

반응형