systemd:在service文件中给Exec传入多个参数
2024-08-27 22:59:32
原问题是这样的:
答案是这样的:
此外在使用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"'
最新文章
- EF框架的三种工作方式
- Hadoop HDFS编程 API入门系列之路径过滤上传多个文件到HDFS(二)
- Cocos2d-X3.0 刨根问底(八)----- 场景(Scene)、层(Layer)相关源码分析
- ssky-keygen + ssh-copy-id 无密码登陆远程LINUX主机
- [英语学习]国外的在线广播网站,类似喜马拉雅和荔枝FM
- Messenger 弹窗的使用
- setTimeout延时0毫秒的作用和问题
- 怎样查看Eclipse是32位还是64位
- Find Minimum in Rotated Sorted Array问题的困惑
- Hibernate 命名查询NamedQuery (转)
- C# 委托与事件详解(二)
- BeautifulSoup总结
- shell-自动按省市建立文件夹,并在每个城市下创建当前日期文件夹
- [JOI2017] サッカー (Soccer)
- Oracle 查看当前数据库版本的方法
- how to build jdk 9 source code
- 20145304 Exp5 MSF基础应用
- [BZOJ1103][POI2007]大都市meg dfs序+树状数组
- nginx配置hls
- pointer-events属性值详解
热门文章
- js----定义变量的几种方式
- 【leetcode】1079. Letter Tile Possibilities
- simulate 中的一些操作
- 用Jquery方法实现的简单下滑菜单效果
- BZOJ 4180: 字符串计数 后缀自动机 + 矩阵乘法 + 二分(神题)
- Windows环境下使用Mycat模拟分库分表-读写分离案例
- [hadoop](2) MapReducer:Distributed Cache
- SQLite多线程下的并发操作
- HttpClient配置及示例代码
- C-LeetCode-Shuffle an Array跑不过测试用例