複数のエラーのため 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-*/最初に読み取る必要があるディストリビューションに関する情報がディレクトリにある可能性があります。

おすすめ記事