1. 에러 나는 데몬들 죽이기
2. 파일 비교하기 (awk와 diff사용)
현재 에러나는 목록
[FAILED] Failed to start Journal Service.
See 'systemctl status systemd-journald.service' for details.
[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.
[FAILED] Failed to start Apply Kernel Variables.
See 'systemctl status systemd-sysctl.service' for details.
[FAILED] Failed to start Rebuild Hardware Database.
See 'systemctl status systemd-hwdb-update.service' for details.
[FAILED] Failed to start Setup Virtual Console.
See 'systemctl status systemd-vconsole-setup.service' for details.
[FAILED] Failed to start Update is Completed.
See 'systemctl status systemd-update-done.service' for details.
[FAILED] Failed to start Security Auditing Service.
See 'systemctl status auditd.service' for details.
[FAILED] Failed to start Self Monitoring and Reporting Technology (SMART) Daemon.
See 'systemctl status smartd.service' for details.
[FAILED] Failed to start firewalld - dynamic firewall daemon.
See 'systemctl status firewalld.service' for details.
[FAILED] Failed to start Login Service.
See 'systemctl status systemd-logind.service' for details.
[FAILED] Failed to start Network Manager.
See 'systemctl status NetworkManager.service' for details.
[FAILED] Failed to start D-Bus System Message Bus.
See 'systemctl status dbus.service' for details.
1. 에러 나는 데몬들 죽이기
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2024-01-04 22:39:06 EST; 2s ago
Docs: man:firewalld(1)
Process: 780 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 780 (code=exited, status=0/SUCCESS)
Jan 04 20:59:59 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan 04 21:00:03 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
Jan 04 21:00:04 localhost.localdomain firewalld[780]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider dis>
Jan 04 22:39:05 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jan 04 22:39:06 localhost.localdomain systemd[1]: firewalld.service: Succeeded.
Jan 04 22:39:06 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
✔ 종속성(의존성) 확인하기 => list-dependencies
[root@localhost ~]# systemctl list-dependencies systemd-journald.service
systemd-journald.service
● ├─system.slice
● ├─systemd-journald-dev-log.socket
● └─systemd-journald.socket
** 현재 죽인 데몬 **
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# systemctl disable systemd-journald
[root@localhost ~]# systemctl disable systemd-journald.socket
[root@localhost ~]# systemctl disable systemd-journald-dev-log.socket
[root@localhost ~]# systemctl disable systemd-journald.service
[root@localhost ~]# systemctl disable smartd
[root@localhost ~]# systemctl disable systemd-udevd
[root@localhost ~]# systemctl disable rsyslog
✨ 모두는 아니지만 몇개 죽이고 테스트 결과 같은 에러가 반복됨
- 데몬들을 죽이고 다시 복사해서 gurp2-mkconfig를 실행 하면 소켓에러는 발생 하지 않지만, 부팅이안되고 똑같이 데몬들을 올라오지 못하고 에러 발생
- systemd-journald.service 는 의존성에 있는 애들도 모두 disable을 했지만 부팅시 실행 되고 있음
2. 파일 비교하기 (awk와 diff사용)
=> 명령어 사용 ls -al /usr/lib | awk '{ print $2" "$1 }' > ./userlib
✔ ls -al을 했을때 각 필드의 의미
구분 | 의미 |
drwxr-xr-x | 권한(퍼미션) |
2 | 하드링크의 수 |
root root | UID(사용자 소유권) GID(그룹 소유권) |
18 | 이 파일(디렉토리)의 크기(byte) |
Jan 5 00:12 | 이 파일이 만들어진 or 수정된 날짜와 시간 |
dev | 파일명 |
파일유형
type | 의미 |
- | 일반파일 |
d | 디렉터리 |
l | 심볼릭 링크 파일 |
.file 명 | file명 앞에 붙는 .은 숨김을 의미 |
b | 블록형 특수 장치파일 (주로 디스크, /dev/sda 등) |
c | 문자형 특수 장치파일 (주로 입출력에 사용, /dev/console 등) |
p | 파이프 파일 |
s | 소켓 파일 |
2-1. /usr/lib/systemd/system/ 여기 디렉토리에 service파일들이 모여있는거 같음.
- /usr/lib/systemd/system/ 디렉토리 안에 위에 에러에서 말하는 서비스 파일들이 존재 하는공간
✔ 두 파일에 ls -al나온 결과 저장하기
[root@localhost ~]# ls -al /usr/lib/systemd/system/ | awk '{ print $1" "$2" "$3" "$4" "$5" "$9 }' > ./userlib
[root@localhost ~]# ls -al /test/usr/lib/systemd/system/ | awk '{ print $1" "$2" "$3" "$4" "$5" "$9 }' > ./testuserlib
💢 결과
[root@localhost ~]# diff userlib testuserlib
[root@localhost ~]#
✨ 두 파일이 같다고 나옴
2-2. 맨 상위인 /usr에서부터 비교하기
✔ 저장
[root@localhost ~]# ls -al /usr/ | awk '{ print $1" "$2" "$3" "$4" "$5" "$9 }' > ./usr
[root@localhost ~]# ls -al /test/usr/ | awk '{ print $1" "$2" "$3" "$4" "$5" "$9 }' > ./testusr
💢 결과
[root@localhost ~]# diff usr testusr
1c1
< total 148
---
> total 124
3,4c3,4
< dr-xr-xr-x. 22 root root 4096 ..
< dr-xr-xr-x. 2 root root 32768 bin
---
> drwxr-xr-x. 18 root root 235 ..
> dr-xr-xr-x. 2 root root 28672 bin
8c8
< dr-xr-xr-x. 47 root root 36864 lib64
---
> dr-xr-xr-x. 47 root root 28672 lib64
✔ bin 디렉토리와 lib64 디렉토리가 크기가 다름
💢 bin 비교 결과
[root@localhost ~]# diff usrbin testusrbin
1,2c1,2
< total 169420
< dr-xr-xr-x. 2 root root 32768 .
---
> total 169412
> dr-xr-xr-x. 2 root root 28672 .
✔ 용량은 다르다고 나오지만 디렉토리 안의 내용물은 같음...
💢 lib64 비교 결과
[root@localhost ~]# diff usrlib64 testusrlib64
1,2c1,2
< total 176356
< dr-xr-xr-x. 47 root root 36864 .
---
> total 176336
> dr-xr-xr-x. 47 root root 28672 .
841c841
< drwxr-xr-x. 2 root root 8192 xtables
---
> drwxr-xr-x. 2 root root 4096 xtables
✔ lib64 비교 결과 xtables 디렉토리가 다름
💢 lib64/xtables 비교 결과
xtables 디렉토리가 하는일
- 시스템에서 xtables 디렉토리는 주로 iptables와 관련된 파일 및 모듈을 포함하는 곳입니다.
- iptables는 리눅스 시스템에서 방화벽 규칙을 관리하는 도구 중 하나이며, 네트워크 패킷 필터링 및 NAT(Network Address Translation) 기능을 수행합니다.
- xtables은 이 iptables에 사용되는 확장 가능한 규칙 엔진의 일부로 사용됩니다.
[root@localhost ~]# diff usrlib64xtab skckdeousrlib64xtab
1,3c1,3
< total 1832
< drwxr-xr-x. 2 root root 8192 .
< dr-xr-xr-x. 47 root root 36864 ..
---
> total 1820
> drwxr-xr-x. 2 root root 4096 .
> dr-xr-xr-x. 47 root root 28672 ..
✔ 비교 결과 xtables 디렉토리 내용물은 같음
✨ 이렇게 하다가는 한도끝도 없겠음.....
'리눅스 > 서버운영' 카테고리의 다른 글
[리눅스]SELinux (0) | 2024.01.10 |
---|---|
[리눅스] 파티션 복사 실습⑦ (퍼미션 비교해보기) (1) | 2024.01.09 |
[리눅스] 파티션 복사 실습⑤ (SELinux비활성화) (0) | 2024.01.04 |
[리눅스] inode (1) | 2023.12.29 |
[리눅스] rsync (0) | 2023.12.28 |
댓글