[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

address@hidden: cfengine2: syslog messages display the hostname instead

From: Andrew Stribblehill
Subject: address@hidden: cfengine2: syslog messages display the hostname instead of the process name]
Date: Mon, 10 Feb 2003 16:00:28 +0000
User-agent: Mutt/1.4i

This is reproducible on 2.0.5b1 too on Linux. Looks like the problem
is that VPREFIX changes over the duration of the process. openlog()
must record the char* that is the prefix parameter as a global
variable somewhere, and then syslog() just prints that each time,
even if it's changed.

The following test code demonstrates it nicely:
#include <stdio.h>
#include <syslog.h>

int main(void)
    char PREFIX[1024];
    syslog(LOG_ERR, "Moo");
    sprintf(PREFIX, "prefix");
    syslog(LOG_ERR, "Baa");
    return 0;

If VPREFIX can't be stopped from changing, could we have a new
variable that doesn't mutate?


----- Forwarded message from Graeme Mathieson <address@hidden> -----

From: Graeme Mathieson <address@hidden>
Subject: cfengine2: syslog messages display the hostname instead of the
        process name
To: Debian Bug Tracking System <address@hidden>
Date: Wed, 06 Nov 2002 15:30:29 +0000

Package: cfengine2
Version: 2.0.4-1
Severity: minor

[ Like I've not bugged you enough today already. :-) ]

Sometimes the various cf.* processes that log to syslog show the name of
the process:

Nov  6 14:20:19 freyja cfservd[11405]:  Logical start time Wed Nov  6 14:08:24 

but sometimes, the decide to replace the process name with the hostname:

Nov  6 08:58:42 freyja freyja[8315]: cfservd starting Wed Nov  6 08:58:42 2002

which makes getting logcheck to spot (or ignore) them a nuisance.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux dream.in.wossname.org.uk 2.4.19-acpi #4 Sat Aug 17 21:59:56 BST 
2002 i686
Locale: LANG=C, LC_CTYPE=C (ignored: LC_ALL set)

Versions of packages cfengine2 depends on:
ii  libc6                         2.3.1-3    GNU C Library: Shared libraries an
ii  libdb3                        3.2.9-17   Berkeley v3 Database Libraries [ru
ii  libssl0.9.6                   0.9.6g-10  SSL shared libraries
ii  perl                          5.8.0-13   Larry Wall's Practical Extraction 

-- no debconf information

----- End forwarded message -----

Andrew Stribblehill <address@hidden>
Systems programmer, IT Service, University of Durham, England

reply via email to

[Prev in Thread] Current Thread [Next in Thread]