2017-01-01 7 views
1

まずsystemctlを使ってraspbianジェシーにmosquittoを開始できませんはこれをしなかった

● mosquitto.service - MQTT v3.1 message broker 
    Loaded: loaded (/etc/systemd/system/mosquitto.service; enabled) 
    Active: failed (Result: start-limit) since Sun 2017-01-01 19:44:03 GMT; 3min 23s ago 
    Process: 683 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE) 
Main PID: 683 (code=exited, status=1/FAILURE) 

Jan 01 19:44:03 raspberrypi systemd[1]: Unit mosquitto.service entered failed state. 
Jan 01 19:44:03 raspberrypi systemd[1]: mosquitto.service holdoff time over, scheduling restart. 
Jan 01 19:44:03 raspberrypi systemd[1]: Stopping MQTT v3.1 message broker... 
Jan 01 19:44:03 raspberrypi systemd[1]: Starting MQTT v3.1 message broker... 
Jan 01 19:44:03 raspberrypi systemd[1]: mosquitto.service start request repeated too quickly, refusing to start. 
Jan 01 19:44:03 raspberrypi systemd[1]: Failed to start MQTT v3.1 message broker. 
Jan 01 19:44:03 raspberrypi systemd[1]: Unit mosquitto.service entered failed state. 

私はたくさんのグーグルを行って、いくつかの同様のユニットファイルを試しましたが、何も動作していないようです。 、.confファイルを指定せずに/usr/sbin/mosquitto、すなわちを実行している、不思議

Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing. 
Error found at /etc/mosquitto/mosquitto.conf:11. 
Error: Unable to open configuration file. 

正常に動作します:手動(/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf)コマンド

ランニング与えます。 /etc/mosquitto/mosquitto.confはデフォルトの.confファイルですので、指定しなくても使用する必要があります。

+0

だから、 '/ usr/sbin/mosquitto -c/etc/mosquitto/mosquitto.conf'を使って手動でmosquittoを起動するとどうなりますか? –

+0

@umläuteそれに対する答えはかなり長いので、私はそれを質問に入れました。 – Alex

+0

質問に追加情報を入れてくれてありがとうございます(これは所属しています)。問題は主に権限があるようです(たとえば、間違ったユーザーとしてプロセスを実行しているなど)。 'journalctl -u mosquitto'の出力は何ですか(systemctl経由で起動しようとして失敗した後) –

答えて

1

何か問題が起こった場合は、通常はログファイル(すべてのコマンドをrootとして実行されると仮定):

journalctl -u mosquitto 

今、あなたの特定のエラー(Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.)を使用すると、アクセス許可の問題に実行されていることをほのめかします。

  • mosquittoデーモンが実行されていることを確認してください。
  • このユーザーがを持っていることを確認してください。 resp。必要なすべてのファイル(例:ログファイル)へ書き込みアクセス

注:それはあなたが間違っているユーザーの下でファイルの作成プロセスを実行した場合、生成されたファイルの間違ったアクセス権を取得するために非常に簡単です(一度だけで十分です -

関連する問題