I have just started playing with prometheus and installed it as a service.
Initially I started it in a screen and let it run but I'd like to run it as a systemd managed service and thus would like to redirect all it's output to a log file however ExecStart=/opt/prometheus/prometheus/prometheus &> /opt/prometheus/prometheus/prometheus.log results in an error, but if I remove the redirection systemd still reports a timeout error but the service is started and running successfully. I did however find this article which is the next best thing I've found thus far but it is not what I want to achieve.
Edit: error message as requested
- Subject: Unit prometheus.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit prometheus.service has begun starting up.
Sep 04 09:14:13 prometheus prometheus[4036]: prometheus: error: unexpected >>
Sep 04 09:14:13 prometheus systemd[1]: prometheus.service: Control process exited, code=exited status=1
Sep 04 09:14:13 prometheus systemd[1]: Failed to start Prometheus monitoring system for monitoring system nodes and services.
-- Subject: Unit prometheus.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit prometheus.service has failed.
--
-- The result is failed.
ExecStart=
line is from/lib/systemd/system/prometheus.service
, isn't it? Did you try to edit it usingsudo systemctl edit --full prometheus
? Please add the error messages you're receiving in their entirety to your question using a code block ({}
button).