carbonapi icon indicating copy to clipboard operation
carbonapi copied to clipboard

[FR] EL7/8 RPM log dir and restart on failure

Open evdevk opened this issue 2 years ago • 1 comments

Clean installation carbonapi centos 8 and red hat 8.5. Checked out on EL7 and EL8 rpm.

Problems:

  1. Carbonapi after install can't start coz no logs directory. Have to create it manually.
  2. On any OOM or other bugs carbonapi won't auto restart which is not so good for any frontends. Have to override systemd manually.

It would be awesome to decrease manual impact in future rpms, so my suggestions:

  1. in systemd unit add restart on-failure or always
[Service]
Restart=on-failure
  1. in rpm bulder add 2 simple commands:
mkdir -p /var/log/carbonapi/
chown -R carbon:carbon /var/log/carbonapi/

evdevk avatar Nov 27 '23 19:11 evdevk

To add, on EL9 it gives the following warning as well:

systemd[1]: /etc/systemd/system/carbonapi.service:10: PIDFile= references a path below legacy directory /var/run/, updating /var/run/carbonapi/carbonapi.pid → /run/carbonapi/carbonapi.pid; please update the unit file accordingly.

Hipska avatar Dec 18 '24 12:12 Hipska