Artificial intelligent assistant

redirect systemd service logs to file I was trying to run flume on Ubuntu 16.04 as systemd service and have following in `/etc/systemd/system/flume-ng.service` [Unit] Description=Apache Flume [Service] ExecStart=/usr/bin/nohup /opt/flume/current/bin/flume-ng agent -c /etc/flume-ng/conf -f /etc/flume-ng/conf/flume.conf --name a1 & ExecStop=/opt/flume/current/bin/flume-ng agent stop [Install] WantedBy=multi-user.target I tried adding following lines StandardOutput=/var/log/flume-ng/log1.log StandardError=/var/log/flume-ng/log2.log which didn't work for me. I did run `systemctl daemon-reload` and `systemctl restart flume-ng` anyone know how this works ?

> `ExecStart=/usr/bin/nohup …`

This is wrong. Remove it. This service is not running in an interactive login session. There is no controlling terminal, or session leader, to send a hangup signal to it in the first place.

> `ExecStart=… &`

This is wrong. Remove it. This is not shell script. `&` has no special shell-like meaning, and in any case would be the wrong way to start a service.

>
> StandardOutput=/var/log/flume-ng/log1.log
> StandardError=/var/log/flume-ng/log2.log

These are wrong. Do not use these. systemd _already sends_ the standard output and error of the service process(es) to its journal, without any such settings in the service unit. You can view it with


journalctl -e -u flume-ng.service

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 05bae1a6b1175bd4171e582c6d7c196f