[Ubuntu] Bkouen MiniPC에 우분투 22.04 설치 후 발생했던 문제들 해결

Bkouen Mini PC에 Ubuntu 22.04.01 server edition에 ubuntu-desktop을 설치한 이후 발생하는 문제들을 해결한 기록이다.

PCIe Bus 에러 발생 처리

아래의 ACPI Error가 난다. 그 후 이더넷 포트에 네트워크 케이블을 연결해두면 로그가 계속 찍히면서 콘솔을 사용할 수 없게 된다.


Feb 25 20:03:27 nas-ubuntu kernel: [    0.383989] pcieport 0000:00:1c.0: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384278] pcieport 0000:00:1c.1: PME: Signaling with IRQ 123
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384343] pcieport 0000:00:1c.1: AER: enabled with IRQ 123
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384387] pcieport 0000:00:1c.1: DPC: enabled with IRQ 123
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384390] pcieport 0000:00:1c.1: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384652] pcieport 0000:00:1c.4: PME: Signaling with IRQ 124
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384711] pcieport 0000:00:1c.4: AER: enabled with IRQ 124
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384753] pcieport 0000:00:1c.4: DPC: enabled with IRQ 124
Feb 25 20:03:27 nas-ubuntu kernel: [    0.384756] pcieport 0000:00:1c.4: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+

...

Feb 25 20:03:27 nas-ubuntu kernel: [    0.385872] ACPI BIOS Error (bug): Could not resolve symbol [\\_SB.PR00._CPC], AE_NOT_FOUND (20210730/psargs-330)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385883]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385885] No Local Variables are initialized for Method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385887]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385889] No Arguments are initialized for method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385891]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385893] ACPI Error: Aborting method \\_SB.PR01._CPC due to previous error (AE_NOT_FOUND) (20210730/psparse-529)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385945] ACPI BIOS Error (bug): Could not resolve symbol [\\_SB.PR00._CPC], AE_NOT_FOUND (20210730/psargs-330)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385952]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385953] No Local Variables are initialized for Method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385955]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385956] No Arguments are initialized for method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385958]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.385960] ACPI Error: Aborting method \\_SB.PR02._CPC due to previous error (AE_NOT_FOUND) (20210730/psparse-529)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386007] ACPI BIOS Error (bug): Could not resolve symbol [\\_SB.PR00._CPC], AE_NOT_FOUND (20210730/psargs-330)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386013]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386015] No Local Variables are initialized for Method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386016]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386018] No Arguments are initialized for method [_CPC]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386019]
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386021] ACPI Error: Aborting method \\_SB.PR03._CPC due to previous error (AE_NOT_FOUND) (20210730/psparse-529)
Feb 25 20:03:27 nas-ubuntu kernel: [    0.386410] ACPI: \\_TZ_.TZ00: Invalid active0 threshold

Troubleshooting PCIe Bus Error severity Corrected on Ubuntu and Linux Mint

네트워크 케이블을 빼두고, 위 링크의 첫번째 해결책(Handling PCIe Bus Error messages if you can boot in to your Linux system)을 사용한다. Disable MSI 해결 방법의 경우 부팅이 안됐다.

# cp /etc/default/grub ~/grub.back
$ sudo vi /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULTpci=noaer 을 추가.

GRUB_CMDLINE_LINUX_DEFAULT="pci=noaer"

아래 명령으로 grub을 업데이트한다.

$ sudo update-grub

위의 방법(”pci=noaer”)은 그냥 ‘Advanced Error Reporting’ 을 disable하는 것이다.

아래 내용도 참고하자. BIOS가 책임져야 하므로 커널 문제는 아니라고 한다. 위의 해결책을 적용해도 커널 로그에 에러는 여전히 찍힌다.

[Solved] ACPI errors during boot – Linux Mint Forums

sssd 설정

아래와 같은 sssd 실패 메시지가 보인다.

에러 메시지는 다음과 같다.

[DEPEND] Dependency failed for SSSD NSS Service responder socket.
[DEPEND] Dependency failed for SSSD AutoFS Service responder socket.
[DEPEND] Dependency failed for SSSD PAC Service responder socket.
[DEPEND] Dependency failed for SSSD PAM Service responder private socket.
[DEPEND] Dependency failed for SSSD PAM Service responder socket.
[DEPEND] Dependency failed for SSSD SSM Service responder socket.
[DEPEND] Dependency failed for SSSD Sudo Service responder socket.

sssd.conf 설정 파일을 /etc/sssd/ 아래에 넣자

$ sudo cp /usr/lib/x86_64-linux-gnu/sssd/conf/sssd.conf /etc/sssd/
$ sudo chmod 600 /etc/sssd/sssd.conf 
$ sudo systemctl enable sssd
$ sudo systemctl status sssd
$ sudo systemctl start sssd
$ sudo systemctl status sssd

reboot 나 halt 불가 해결

대기 모드 진입했다 다시 사용했다 하면 갑자기 GUI 진입 후 shell 에서 입력 출력 에러가 나오고, reboot나 halt도 안먹는다. 이런 에러가 나온다.

[!!!!!!] Failed to execute shutdown binary.

[22.04][EHL] can not shutdown and reboot

위 링크의 해결책을 사용했다.

sudo vi /etc/modprobe.d/blacklist.conf

아래 줄을 추가한다.

blacklist pinctrl_elkhartlake

이후 아래 명령을 실행한다.

sudo update-initramfs -u

그리고 재부팅.

[Ubuntu] cron-apt로 패키지 자동 업데이트 하기

2024.11.27. Update: 아래 내용 말고 https://blog.dasomoli.org/ubuntu-%ec%9e%90%eb%8f%99-%ec%97%85%eb%8d%b0%ec%9d%b4%ed%8a%b8-%ec%84%a4%ec%a0%95/ 을 사용해보자.


cron-apt를 설치하면 오전 4시에 알아서 패키지 업데이트를 해준다.

sudo apt-get install cron-apt

/etc/cron.d/cron-apt 파일 안에서 시간 설정을 바꿀 수 있다. 나는 오전 5시로 바꿨다.

root@bamtol:/etc/cron.d# cat /etc/cron.d/cron-apt
#
# Regular cron jobs for the cron-apt package
#
# Every night at 5 o'clock.
0 5	* * *	root	test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt
# Every hour.
# 0 *	* * *	root	test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt /etc/cron-apt/config2
# Every five minutes.
# */5 *	* * *	root	test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt /etc/cron-apt/config2

참고: https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo

[Ubuntu] 20.04에서 Jenkins 설치하기

1. java 설치되어 있는지 확인(java -version) 후 없으면 open-jdk 설치

sudo apt-get install openjdk-8-jdk

2. repository 키 추가

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

3. sources.list 에 추가

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

4. jenkins를 apt-get 으로 설치

sudo apt-get update && apt-get install jenkins

5. Jenkins 시작

sudo systemctl start jenkins

6. 혹시 방화벽 있으면 열기

sudo ufw allow 8080

7. http://IP:8080 으로 Jenkins 최초 접속. Administrator password는 아래에서 얻는다.

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

그 다음은 그냥 쭉쭉 진행! 생략…

참고: https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-20-04

[Linux] KVM의 Bridge mode network 사용 시 네트워크 사용 불가 문제

KVM 사용 시 Bridge mode로 GuestOS에 네트워크 셋팅을 해도 동작을 안하는 경우가 있다. 게이트웨이나 DNS로 ping조차 안가는데, docker 와 함께 사용 시 문제가 발생한다.

docker가 iptables 의 FORWARD chain의 정책을 DROP으로 해버리기 때문이다.

oot@justiny-desktop:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy DROP)
target     prot opt source               destination         
DOCKER-USER  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER (1 references)
target     prot opt source               destination         

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination         
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-USER (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere 

다음처럼 해주면 잘된다.

# iptables -A FORWARD -i br0 -o br0 -j ACCEPT

[Windows+Linux] WSL 사용 시 참고

Ubuntu 20.04 내의 파일 저장 경로

WSL 1

%localappdata%\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows어쩌고저쩌고\LocalState\rootfs\

예를 들어, C:\Users\dasom\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs

WSL 2

\\wsl$ 를 입력하면 배포판이 보인다.

\\wsl$\Ubuntu-20.04

GUI

Xming 같은 Xserver를 사용해서 WSL로 설치한 Ubuntu 등에서 GUI 를 사용할 수 있다.

WSL 1을 WSL 2로 변환하기

WSL로 설치한 항목은 다음으로 확인 가능하다.

wsl -l -v

여기서 WSL Version이 1인 것을 다음과 같이 2로 바꿀 수 있다. 예제로 Ubuntu-20.04 를 바꾸고 싶다면 다음과 같이 하면 된다.

wsl --set-version Ubuntu-20.04 2

실행 시 기본 유저 바꾸기

명령 프롬프트에서 다음을 실행한다.

ubuntu config --default-user new_dasomoli

참고

아래 글이 매우 정리가 잘 되어 있다.

[go] Ubuntu 에서 go 여러버전 사용하기

Ubuntu 리눅스에서 go의 여러 버전을 심볼릭 링크로 사용할 때 update-alternatives로 셋팅해서 사용하자.

# update-alternatives --install /usr/local/go go /usr/local/go1.17.2 1
update-alternatives: using /usr/local/go1.17.2 to provide /usr/local/go (go) in auto mode

# update-alternatives --install /usr/local/go go /usr/local/go1.16.8 2
update-alternatives: using /usr/local/go1.16.8 to provide /usr/local/go (go) in auto mode

# update-alternatives --install /usr/local/go go /usr/local/go1.14.15 3
update-alternatives: using /usr/local/go1.14.15 to provide /usr/local/go (go) in auto mode

# update-alternatives --config go
대체 항목 go에 대해 (/usr/local/go 제공) 3개 선택이 있습니다.

  선택       경로                우선순� 상태
------------------------------------------------------------
* 0            /usr/local/go1.14.15   3         자동 모드
  1            /usr/local/go1.14.15   3         수동 모드
  2            /usr/local/go1.16.8    2         수동 모드
  3            /usr/local/go1.17.2    1         수동 모드

현재 선택[*]을 유지하려면 <엔터>를 누르고, 아니면 선택 번호를 입력하시오:
#

[Linux] Gzip으로 압축된 로그 파일 다루기

logrotate를 사용하면 /var/log 아래에 gzip된 로그 파일(.gz)들이 남는다.

로그 파일을 보고 싶을 때 압축을 풀어서 봐도 되지만, 압축을 풀지 않고 다룰 수 있는 명령어들이 있다.

  • zcat: 압축된 파일 보기
  • zgrep: 압축된 파일에서 grep
  • zless: gz파일을 위한 less. zmore도 있다.

zless log.gz 이면 로그 파일 보는데 큰 문제 없을 거다.

zcat으로 | 하여 파이프를 통해 이용하는 것도 좋은 방법이다.

more는 오래된 도구로 less와의 차이는 less는 앞 쪽으로도 스크롤이 된다. more는 뒤로만 된다.

 

[Linux] logrotate 설정

로그 남길 때 그냥 주구장창 남기면 디스크가 꽉 찬다.

/var/log 아래 남는 log 들처럼 주기적으로 gzip으로 압축하고, 오래된 로그는 저절로 지워지도록 하고 싶을 때 logrotate를 쓴다.

logrotate를 설정해서 주기마다 압축해서 남기고, 때 되면 지우도록 만들자.

아래 명령은 도움말인 man page를 보여 준다.

# man logrotate

 

logrotate의 설정 파일들은 아래에서 찾을 수 있다.

/etc/logrotate.conf : logrotate의 기본 설정 파일. 여기서 /etc/logrotate.d/ 아래의 파일들을 include 하도록 되어 있다.
/etc/logrotate.d/ : logrotate를 사용해서 로그를 남기고 싶은 유틸리티들이 여기다 설정 파일을 둔다.

 

예제를 보자.

# vi /etc/logrotate.d/mysqlmon
/var/log/mysqlmon/mysqlmon.log /var/log/mysqlmon/mysqlmon.err {
        daily
        missingok
        rotate 7
        compress
        notifempty
}

위의 예제의 각 옵션은 다음과 같다.

daily: 하루 주기

missingok: 로그 파일이 없어도 에러 메시지를 쓰지 않는다.

rotate 7: 오래된 로그를 7개 남긴다.

compress: gzip으로 압축한다.

notifempty: 로그 파일이 비어 있으면 rotate하지 않는다.

다른 자세한 옵션은 man page를 참고하자.