On Thu, Dec 22, 2016 at 11:32:38AM +0100, Landry Breuil wrote:
> On Thu, Dec 22, 2016 at 11:22:49AM +0100, Antoine Jacoutot wrote:
> > On Wed, Dec 21, 2016 at 05:51:56AM -0700, Landry Breuil wrote:
> > > CVSROOT:  /cvs
> > > Module name:      ports
> > > Changes by:       [email protected]  2016/12/21 05:51:56
> > > 
> > > Log message:
> > >     Import riemann 0.2.12, from MAINTAINER Pavel Korovin /p/tristero/se
> > >     
> > >     Riemann provides low-latency, transient shared state for systems with 
> > > many
> > >     moving parts.
> > >     Riemann aggregates events from your servers and applications with a 
> > > powerful
> > >     stream processing language. Send an email for every exception raised 
> > > by your
> > >     code. Track the latency distribution of your web app. See the top 
> > > processes
> > >     on any host, by memory and CPU. Combine statistics from every Riak 
> > > node in
> > >     your cluster and forward to Graphite. Send alerts when a key process 
> > > fails
> > >     to check in. Know how many users signed up right this second.
> > >     
> > >     ok sthen@
> > >     
> > >     Status:
> > >     
> > >     Vendor Tag:   pkorovin
> > >     Release Tags: landry_20161221
> > >     
> > >     N ports/sysutils/riemann/Makefile
> > >     N ports/sysutils/riemann/distinfo
> > >     N ports/sysutils/riemann/patches/patch-etc_riemann_config
> > >     N ports/sysutils/riemann/patches/patch-bin_riemann
> > >     N ports/sysutils/riemann/pkg/riemann.rc
> > >     N ports/sysutils/riemann/pkg/DESCR
> > >     N ports/sysutils/riemann/pkg/PLIST
> > >     
> > >     No conflicts created by this import
> > 
> > The rc.d script is weird, here are some proposed changes:
> > - put variable where they belong and follow the template
> > - we set rc_bg, so use ${_bg}
> > - no need to run in a sub-shell
> > - drop daemon_log, the name looks too much like an rc.d variable
> > - while here, drop the log file altogether; do we really need it? it's
> >   overwritten each time riemann starts
> 
> I thought about this recently and i think we need way to redirect stdout
> to a logfile for some sucky daemons who just dont know how to log to
> syslog or to a file (node.js apps come to my mind...) - and so far, the
> only way i found was to override rc_start the same way it's done here,
> which feels hackish.
> 
> So how about providing this within rc.subr via daemon_log or
> daemon_stdout ?

I don't think it's the job of rc.d to do that.
Also, in this case it's getting overwritten each times it is started.
Since /usr/local/bin/riemann is just a shell script, you can always patch it
to pipe into logger(1) or something. But having the rc.d script redirect
everything into a log file like that is not good. Also it hides everything
when you run the script in debug mode (`-d').


> other than that, yes using rc_bg is definitely better, i hadnt seen the
> &.
> 

-- 
Antoine

Reply via email to