go-graphite / carbonapi

Implementation of graphite API (graphite-web) in golang
Other
308 stars 140 forks source link

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

Open evdevk opened 8 months ago

evdevk commented 8 months ago

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

2) in rpm bulder add 2 simple commands:

mkdir -p /var/log/carbonapi/
chown -R carbon:carbon /var/log/carbonapi/