개발자/라즈베리파이4

Raspberry pi4 Access Point setup problem solved

지구빵집 2021. 7. 30. 10:18
반응형

 

 

Raspberry pi4 Access Point setup problem solved  

 

이전 포스팅에 문제 해결 방법을 코드로 표시했지만 설명이 부족한 듯하여 다시 올립니다. 이전 버전의 Raspberry Pi를 Access Point로 설정하는 방법을 그대로 따라 하면 정상적으로 되는 데 라즈베리파이 4부터는 /etc/rc.local 파일 활성화시키는 문제와 rc.local 파일에서 실행되는 hostapd.service 파일이 실행되지 않는 두 가지 문제가 발생합니다. 다른 것은 제처 두고라도 이 두 가지 문제는 아래와 같은 방법으로 해결하면 됩니다.

 

1. rc.local 활성화 방법에 대해 정리한 문서를 참고하세요.

 

2. 위 문서를 따라 활성화를 하면 잘 동작합니다. 에러는 rc.local 활성화 문제가 아니고 rc.local 파일의 실행파일에 문제가 있어서 아래와 같은 메시지가 나옵니다.

 

우선 상태를 확인하기 위해 명령어를 참고합니다.

 

$systemctl status rc-local.service

 

그러면 아래와 같은 메시지가 나오는데, 아래에서 4번째 줄을 보면 Failed to start hostapd.service: Unit hostapd.service 란 글이 보이는데 바로 rc.local 파일 활성화 문제가 아니라 hostapd 서비스가 마스크 되어 실행하지 않는 문제입니다. 

 

pi@raspberrypi:~ $ systemctl status rc-local.service
Warning: The unit file, source configuration file or drop-ins of rc-local.service changed on disk. Run 'systemctl d
● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/rc-local.service.d
           └─debian.conf
           /etc/systemd/system/rc-local.service.d
           └─ttyoutput.conf
   Active: failed (Result: exit-code) since Mon 2021-07-26 18:33:09 KST; 31min ago
     Docs: man:systemd-rc-local-generator(8)
  Process: 480 ExecStart=/etc/rc.local start (code=exited, status=1/FAILURE)

 7월 26 18:33:01 raspberrypi systemd[1]: Starting /etc/rc.local Compatibility...
 7월 26 18:33:01 raspberrypi rc.local[480]: wlan0     Interface doesn't support scanning : Network is down
 7월 26 18:33:09 raspberrypi rc.local[480]: Failed to start hostapd.service: Unit hostapd.service is masked.
 7월 26 18:33:09 raspberrypi systemd[1]: rc-local.service: Control process exited, code=exited, status=1/FAILURE
 7월 26 18:33:09 raspberrypi systemd[1]: rc-local.service: Failed with result 'exit-code'.
 7월 26 18:33:09 raspberrypi systemd[1]: Failed to start /etc/rc.local Compatibility.

 

따라서 아래 명령어들을 사용하여 상태를 보거나 실행하면 제대로 실행되지 않는다. 안해봐도 뻔하다.

 

$ systemctl status hostapd
● hostapd.service
   Loaded: masked (Reason: Unit hostapd.service is masked.)
   Active: failed (Result: exit-code) since Sat 2020-05-09 23:02:20 KST; 11min ago

 5월 09 23:02:20 raspberrypi systemd[1]: hostapd.service: Service RestartSec=100ms expired, scheduling restart.
 5월 09 23:02:20 raspberrypi systemd[1]: hostapd.service: Failed to schedule restart job: Unit hostapd.service is masked.
 5월 09 23:02:20 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
 
구동이 안된다!!

$ sudo service hostapd restart
Failed to restart hostapd.service: Unit hostapd.service is masked.

 

이 문제는 아래 3개의 명령어를 순차적으로 실행하면 문제 해결이다.

 

$ sudo systemctl unmask hostapd
$ sudo systemctl enable hostapd
$ sudo systemctl start hostapd

 

문제를 해결하고 잘 실행되는 상태에서 확인하면 아래와 같이 아름다운 메시지를 볼 수 있다.

 

pi@raspberrypi:~ $ sudo systemctl status rc-local
Warning: The unit file, source configuration file or drop-ins of rc-local.service changed on disk. Run 'systemctl d
● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; enabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/rc-local.service.d
           └─debian.conf
           /etc/systemd/system/rc-local.service.d
           └─ttyoutput.conf
   Active: active (exited) since Mon 2021-07-26 19:33:35 KST; 16min ago
     Docs: man:systemd-rc-local-generator(8)
  Process: 482 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)

 7월 26 19:33:17 raspberrypi systemd[1]: Starting /etc/rc.local Compatibility...
 7월 26 19:33:35 raspberrypi systemd[1]: Started /etc/rc.local Compatibility.

pi@raspberrypi:~ $

 

-끝

 

조금씩 나아지기 위해서, 일상을 지탱하는 리듬, 조화, 균형, 반복을 빼먹지 않고 실행하는 루틴을 제외하고 매일매일 같은 활동을 하면 성장은 없다. 매일 같은 시간에 조금도 다르지 않은 사무실로 오고, 매일 만나는 사람을 만나고, 늘 하던 일을 한다는 자체가 어떻게 보면 발전이 없다는 사실을 분명하게 보여주는 증거다. 누군가 보여주는 태도와 행동을 이해하긴 어렵지만 보여주는 사실은 확실하다.

 

늘 다르게 생각하고, 다르게 행동하고, 다른 데로 이동하는 방법을 고민해야 한다. 변하지 않기 때문에 경쟁하는 삶 속으로 들어가는 것이고, 바꾸지 않기 때문에 창조하지 못하는 것이다. 경쟁하는 곳은 일단 실패다. 무조건 다른 대륙을 찾아 떠난다. 창조하는 일에는 경쟁이 없다. 건승을 빈다.

 

 

절대로 넘어오는 법이 없는 길냥이

 

 

 

 

반응형