CentOS7:prometheus添加开机启动,执行systemctl enable prometheus报错:Failed to execute operation: Bad message
开机启动代码:
[Unit]
Description=Prometheus Monitoring System
Documentation=Prometheus Monitoring System
[Service]
Execstart=/usr/local/prometheus-2.34.0.linux-amd64/prometheus --config.file=/usr/local/prometheus-2.34.0.linux-amd64/prometheus.yml --web.listen-address=:9090
[Install]
WantedBy=multi-user.target
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl enable prometheus
Failed to execute operation: Bad message
问题原因:Execstart写错了
解决办法:将Execstart写成ExecStart