systemd:在service文件中给Exec传入多个参数
原问题是这样的:
答案是这样的:
此外在使用prometheus监控mongodb时需要安装prometheus-mongodb-exporter,过程中也发现这种用法:
看看service单元文件是怎么写的:
cat /lib/systemd/system/prometheus-mongodb-exporter.service
内容如下:
[Unit] Description=Prometheus exporter for MongoDB Documentation=https://github.com/dcu/mongodb_exporter [Service] Restart=always User=prometheus EnvironmentFile=/etc/default/prometheus-mongodb-exporter ExecStart=/usr/bin/prometheus-mongodb-exporter $ARGS [Install] WantedBy=multi-user.target
在看看这个 EnvironmentFile
:
cat /etc/default/prometheus-mongodb-exporter
内容如下:
# Set the command-line arguments to pass to the server. ARGS='-mongodb.uri="mongodb://localhost:27017"'
相关推荐
Schvian 2020-11-04
hpujsj 2020-07-26
txj 2020-06-12
suosuo 2020-06-08
suosuo 2020-05-28
cwgxiaoguizi 2020-05-28
夜雨倚琴 2020-04-19
liusaisoso 2020-01-17
scmrpu 2020-01-17
csdnyasin 2020-01-10
csdnyasin 2020-01-05
糊一笑 2019-12-20
83530391 2019-12-12
sweetgirl0 2019-12-07
bearhoopIT之道 2019-11-24
Caleb0 2019-11-26