여러 오류로 인해 Hostapd를 시작할 수 없습니다

여러 오류로 인해 Hostapd를 시작할 수 없습니다

Hostapd를 시작하려고 할 때 여러 오류가 발생합니다. Hostapd를 시작하려고 시도한 후 나타나는 오류 출력을 게시하고 상태를 확인하겠습니다.

   root@l0calh0st:~# service hostapd status
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-01-07 16:42:38 CET; 4s ago
  Process: 1682 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, sta

Jan 07 16:42:38 l0calh0st systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticato
Jan 07 16:42:38 l0calh0st hostapd[1682]: Configuration file:
Jan 07 16:42:38 l0calh0st hostapd[1682]: Could not open configuration file '' for reading.
Jan 07 16:42:38 l0calh0st hostapd[1682]: Failed to set up interface with
Jan 07 16:42:38 l0calh0st hostapd[1682]: Failed to initialize interface
Jan 07 16:42:38 l0calh0st systemd[1]: hostapd.service: Control process exited, code=exited status=1
Jan 07 16:42:38 l0calh0st systemd[1]: hostapd.service: Failed with result 'exit-code'.
Jan 07 16:42:38 l0calh0st systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authe

왜 그가 구성 파일을 찾을 수 없는지 모르겠습니다. 그는 ""를 검색하고 있는 것 같은데 아무것도 검색하지 않는 것 같습니다...! 저는 아무것도 편집하지 않았습니다...! 정상적으로 시작하려고 하면:

root@l0calh0st:~# service  hostapd start
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.

"journalct1 -xe" 명령을 사용하면 다음과 같은 결과가 나타납니다.

root@l0calh0st:~# journalctl -xe
-- Unit systemd-tmpfiles-clean.service has finished starting up.
-- 
-- The start-up result is RESULT.
Jan 07 16:57:44 l0calh0st systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
-- Subject: Unit hostapd.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit hostapd.service has begun starting up.
Jan 07 16:57:44 l0calh0st hostapd[1865]: Configuration file:
Jan 07 16:57:44 l0calh0st hostapd[1865]: Could not open configuration file '' for reading.
Jan 07 16:57:44 l0calh0st hostapd[1865]: Failed to set up interface with
Jan 07 16:57:44 l0calh0st hostapd[1865]: Failed to initialize interface
Jan 07 16:57:44 l0calh0st systemd[1]: hostapd.service: Control process exited, code=exited status=1
Jan 07 16:57:44 l0calh0st systemd[1]: hostapd.service: Failed with result 'exit-code'.
Jan 07 16:57:44 l0calh0st systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd 
-- Unit hostapd.service has failed.
-- 
-- The result is RESULT.
lines 1521-1543/1543 (END)

편집: 좋습니다. "hostapd.service" 파일을 찾았지만 주석 처리된 내용은 없습니다. (#?):

[Unit]
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
After=network.target

[Service]
Type=forking
PIDFile=/run/hostapd.pid
EnvironmentFile=/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

[Install]
WantedBy=multi-user.target

이것은 /etc/default/hostapd 파일입니다:

# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
#DAEMON_CONF=""

# Additional daemon options to be appended to hostapd command:-
#   -d   show more debug messages (-dd for even more)
#   -K   include key data in debug messages
#   -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

답변1

귀하의 시스템은 . 일부 배포판에서 레거시 래퍼를 사용하면 systemd-native 명령을 사용하여 표시되는 일부 오류 메시지를 숨길 수 있음 systemd을 확인했습니다 . 하지만 여기에는 충분한 정보가 있는 것 같습니다.servicesystemctl

/lib/systemd/system/hostapd.service파일 에서 시작하는 데 사용되는 실제 명령을 결정하는 줄 hostapd은 다음과 같습니다.

ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

systemd기본 설정( man systemd.exec세부 사항 참조) 이외의 환경 변수 가 포함되어 있으므로 파일에는 또는 같은 hostapd.service옵션이 있어야 합니다 . 아마도 다음과 같을 것입니다:Environment=EnvironmentFile=PassEnvironment=

EnvironmentFile=/etc/default/hostapd.conf

그러한 파일이 존재하는 경우 시스템 구성과 일치하도록 편집한 다음 시작하기 전에 주석 처리를 제거해야 하는 일부 주석 처리된 기본값이 있을 수 있습니다 hostapd.

일반적으로 이러한 파일은 배포 관리자가 준비하며 수행해야 할 작업을 설명하는 유용한 설명이 포함되어 있습니다. 그렇지 않은 경우 /usr/share/doc/hostapd-*/먼저 읽어야 할 배포판 관련 정보가 디렉터리에 있을 수 있습니다 .

답변2

나는 Raspbian Stretch에서 당신과 같은 문제를 겪었습니다. 그냥 검색해봄packages.debian.org두 개의 다른 패키지를 찾았습니다.
설치했습니다"hostapd_2.4-1+deb9u4_armhf.deb"많은 문제가 있습니다. 그래서 설치했어요"hostapd_2.7+git20190128+0c1e29f-4_bpo9+2_armhf.deb"이것은 좋다.

관련 정보