首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >忽略未知转义序列:"\“

忽略未知转义序列:"\“
EN

Unix & Linux用户
提问于 2021-10-14 23:10:24
回答 1查看 690关注 0票数 2

我正在尝试根据本教程启动一项服务:

代码语言:javascript
复制
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时:

代码语言:javascript
复制
systemd[1]: /etc/systemd/system/prometheus.service:10: Ignoring unknown escape sequences: "\"
systemd[1]: /etc/systemd/system/prometheus.service:11: Missing '='.

我试过纳诺和维。

EN

回答 1

Unix & Linux用户

发布于 2021-10-15 07:17:02

start Prometheus的命令应该是:

代码语言:javascript
复制
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"

检查= in --config-file--storage.tsdb.path。并移除尾随空间

票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/673283

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档