不明なエスケープシーケンスを無視: "\"

不明なエスケープシーケンスを無視:

チュートリアルに基づいてサービスを開始しようとしています。

Description=Prometheus Time Series Collection and Processing Server  
Wants=network-online.target  
After=network-online.target  
  
[Service]  
User=prometheus  
Group=prometheus  
Type=simple  
ExecStart=/usr/local/bin/prometheus \  
    --config.file /etc/prometheus/prometheus.yml \  
    --storage.tsdb.path /var/lib/prometheus/ \  
    --web.console.templates=/etc/prometheus/consoles \  
    --web.console.libraries=/etc/prometheus/console_libraries\  
    --web.listen-address="0.0.0.0:9091"  
  
[Install]  
WantedBy=multi-user.target

Failed to enable unit: File prometheus.service: Invalid argumentしかし、ログを受け取るたびに:

systemd[1]: /etc/systemd/system/prometheus.service:10: Ignoring unknown escape sequences: "\"
systemd[1]: /etc/systemd/system/prometheus.service:11: Missing '='.

私はnanoとviの両方でそれを試しました。

ベストアンサー1

Prometheusを起動するコマンドは次のようになります。

ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.listen-address="0.0.0.0:9091"

チェック=インし、末尾の--config-fileスペース--storage.tsdb.pathを削除します。

おすすめ記事