On Fri 29/03 17:47, Antoine Jacoutot wrote:
> On Fri, Mar 29, 2019 at 05:18:17PM +0100, Joel Carnat wrote:
> > Hi,
> > 
> > InfluxDB doesn't seem to have an internal way to forward its logs to a
> > file or syslog. As far as I understood, one has to get the information
> > from STDOUT/STDERR.
> > 
> > The following patch allows sending the logs to syslog. It uses the
> > logger(1) utility. It is based on what is done with sysutils/prometheus.
> > 
> > BTW, it seems there's no "MAINTAINER" in the Makefile.
> > 
> > Regards.
> 
> > --- databases/influxdb/pkg/influxdb.rc.orig Thu Jan 11 20:27:01 2018
> > +++ databases/influxdb/pkg/influxdb.rc      Fri Mar 29 17:12:07 2019
> > @@ -4,4 +4,6 @@
> >  
> >  daemon="${TRUEPREFIX}/bin/influxd"
> > +daemon_flags=""
> > +daemon_priority="daemon.info"
> 
> Don't use a non standard daemon_ variable please.
> I think it's fine to hardcode daemon.info like prometheus does.
> 
> >  daemon_user="_influx"
> >  
> > @@ -10,4 +12,9 @@
> >  rc_bg=YES
> >  rc_reload=NO
> > +
> > +rc_start() {
> > +  ${rcexec} "${daemon} ${daemon_flags} 2>&1 | \
> > +    logger -p ${daemon_priority} -t influxd"
> > +}
> 
> Use tabs, like other rc.d scripts.
> 

Here's the modified patch.

--- databases/influxdb/pkg/influxdb.rc.orig     Thu Jan 11 20:27:01 2018
+++ databases/influxdb/pkg/influxdb.rc  Fri Mar 29 18:41:12 2019
@@ -4,4 +4,5 @@
 
 daemon="${TRUEPREFIX}/bin/influxd"
+daemon_flags=""
 daemon_user="_influx"
 
@@ -10,4 +11,9 @@
 rc_bg=YES
 rc_reload=NO
+
+rc_start() {
+       ${rcexec} "${daemon} ${daemon_flags} 2>&1 | \
+               logger -p daemon.info -t influxd"
+}
 
 rc_cmd $1

Reply via email to