相关疑难解决方法(0)

如何将systemd服务的输出重定向到文件

我试图将系统服务的o/p重定向到文件但它似乎不起作用.我这样做如下:

[Unit]
Description=customprocess
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server
StandardOutput=/var/log1.log
StandardError=/var/log2.log
Restart=always

[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

请建议将o/p重定向到文件的正确方法

linux rhel systemd centos7 rhel7

136
推荐指数
7
解决办法
14万
查看次数

标签 统计

centos7 ×1

linux ×1

rhel ×1

rhel7 ×1

systemd ×1