How to redirect output of systemd service to a file
问题 I am trying to redirect output of a systemd service to a file but it doesn\'t seem to work: [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 Please correct my approach. 回答1: I think there's a more elegant way to solve the problem: send the stdout/stderr to syslog with an identifier and