[rrd-developers] rrdcached daemonize failed, exiting

Florian Forster rrdtool at nospam.verplant.org
Wed Sep 24 08:00:52 CEST 2008


On Tue, Sep 23, 2008 at 06:55:36AM +0200, Tobias Oetiker wrote:
> I guess in the long run it would save us quite some ML traffic if the
> rrdcached was more forthcoming about the reasons for its failure to
> launch ...

the daemon uses a variadic macro, `RRDD_LOG', to log messages. One way
to get the daemon easier to debug could be to change that to a function
-- 8< --
 static int is_daemonized = 0;
 static int rrdd_log (severity, format, ...)
   va_list ap;
   int status;

   va_start (ap, format);

   if (is_daemonized)
     status = vsyslog (sevetiry, format, ap);
     status = vfprintf (stderr, format, ap);
   va_end (ap);

   return (status);
 } /* int rrdd_log */
-- >8 --
Please note:
- The `vsyslog' function is not standardized. We would need to check for
  it using the configure script and write a backup solution ourselves to
  make that portable.
- As the code is layed out at the moment, this would result in the same
  behavior that was observed (i. e. the message would be in syslog
  because STDOUT is closed before writing the PID file).
- I didn't look up the return value of *syslog in the manpage, so the
  status variable may need to be touched to guarantee a uniform success/
  failure return value.

I've also noted that syslog is not mentioned in the rrdcached(1) manual
page anywhere.. I'll send a patch in a minute..

Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20080924/a1f5695a/attachment.bin 

More information about the rrd-developers mailing list