|
Bugzilla – Full Text Bug Listing |
| Summary: | syslog does not get right hostname when dhcp is used | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Carsten Hoeger <choeger> |
| Component: | Network | Assignee: | Marius Tomaschewski <mt> |
| Status: | VERIFIED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | coolo, heiko.rommel, kukuk, mc, meissner, mt, werner |
| Version: | Beta 1 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Bug Depends on: | 134160 | ||
| Bug Blocks: | |||
| Attachments: | Patch to update the cached hostname in syslog-ng on SIGHUP | ||
|
Description
Carsten Hoeger
2005-09-12 12:51:50 UTC
hurwitz:~ # cat /etc/HOSTNAME linux.site (The dhcp client never writes /etc/HOSTNAME. that file is only written by YaST.) What does /var/lib/dhcpcd/dhcpcd-eth0.info contain? IPADDR=10.10.0.19 NETMASK=255.255.0.0 NETWORK=10.10.0.0 BROADCAST=10.10.255.255 GATEWAY=10.10.0.8 HOSTNAME='hurwitz' DOMAIN='suse.de' NISDOMAIN='suse.de' DNS=10.10.0.1,149.44.160.146,10.10.2.88 DNSSEARCH='suse.de nue.novell.com' NTPSERVERS=149.44.160.50,149.44.160.54,149.44.160.1 WINSSERVERS=149.44.160.39 NISSERVERS=149.44.160.146,10.10.0.1,149.44.160.50 LPRSERVERS=149.44.160.33 DHCPSID=149.44.160.50 DHCPGIADDR=10.10.255.254 DHCPSIADDR=149.44.160.50 DHCPCHADDR=00:00:1C:B5:65:16 DHCPSHADDR=00:03:47:97:4E:3A DHCPSNAME='Idun.suse.de' LEASETIME=1296000 RENEWALTIME=648000 REBINDTIME=1134000 INTERFACE='eth0' CLASSID='Linux 2.6.13-10-default i686' CLIENTID=00:00:1C:B5:65:16 and 'hostname -f'? hurwitz:~ # hostname -f hurwitz.suse.de then all is right... but syslog needs a reload. I think this is either not a bug, or we decided that it is not a bug. I vaguely remember a discussion about remote logging, or how logfiles from many machines are aggregated otherwise, and how the the machine name matters there. I wonder whether the current behaviour is new since syslog is started earlier than before 9.3, or if it has always been like this. Stephan, do you know? It doesn't matter if dhcp writes /etc/HOSTNAME or not in this case. But syslog should not use linux if another hostname is set later, else the syslog host will have useless informations (all clients reports as linux). It seems like the current behaviour is somehow related to the kind of installation . On a testsystem (minimal+X, boots into runlevel 3) the problem does not exit. It would matter if dhcpcd writes /etc/HOSTNAME -- because dhcpcd actually uses that file. It contains the hostname which is sent with a DHCP request and which might be used by a DHCP server to register that name in a network via dynamic DNS updates. Werner? Coolo? (And I wonder, does the syslog host actually use a name as sent from the client? Doesn't it do DNS lookups instead?) Hmmm ... Do you use syslog-ng or syslog? Nevetheless, the old syslogd initiallize the hostname with the help of gethostname only once. The question then is: What service is started first, dhcp or syslog(-ng)? in init3, syslog(-ng) always starts after network, in init5 there is earlysyslog which starts syslog before network if there are no network log targets defined. So: if the host name matters in syslog files even though you're only doing local logging, we need to some signaling to the syslog daemon when the hostname changes. If that's not possible: WONTFIX. Christian, what do you think about adding 'rcsyslog reload' to /etc/sysconfig/network/scripts/dhcpcd-hook ? Why not. Do we know in dhcpcd-hook if the hostname was changed? This should also be added to NetworkManager and friends or to dhclient. Roughly; we know if the IP address has changed. I have added it for STABLE (it is in the sysconfig CVS). Reassigning for NetworkManager. Timo: This is the same as bug #134160, no? Not exactly, but #134160 relates since I expect dhcdbd not to set the domain name and host name, too. *** Bug 144324 has been marked as a duplicate of this bug. *** hostname is still not being set in Beta1 in some situations. Should be fixed by Beta2. Moving to 10.1 beta1. I'll take care. Sorry, I haven't read the bug carefully enough. Reverting summary. Apparently, syslog-ng does not update the hostname used for logging when signaled with HUP. The current fix (reloading syslog) is useless unless we a) _restart_ syslog or b) patch syslog-ng to update the hostname when signaled with HUP Please decide what to do and reaasign to me if i should change it to restart. Will it be neccessary to change NetworkManager as well? I guess this problem it not important on systems using NM. If required, we could add a dispatcher script. Though, I do not think that this issue matters for NM's audience. QA recommends to repair :-) So I reassign to Christian again would you mind to write something understandable? repair syslog-ng? rcnetwork repair? (do you mean restart?) And who is QA in this case? Our QA-Team tested. In person: Heiko. Then maybe Heiko will be able to explain, what we should do and why? I was asking the syslog-nt maintainer which solution he prefers. Again the question from comment 22 and 23 was not answered. Back to mt. Marius, is it a bug of syslog-nt that it does not reread hostname on HUP? Will that change? On the other side, is it ok to restart syslog or may that possibly lose log messages? Changing reload -> restart is no problem for me. Marius (or someone else who knows syslog-ng), please answer. This week. I've tested what happens to syslog-ng if the hostname changes. The code looks like it calls gethostname (that returns the new one) for local sources (unix sockets) and uses the cached DNS hostname of the source-socket in case of inet sockets. This should work fine also without a HUP. But in fact, this is not really the case - it uses a cached (the old) one. I consider this as a bug, but while my first look into the source code, I was not able to find the place where it happens and have to take a closer on it (add a printf debugger) to provide a fix. I'll try to provide a fix this week. [...] of the source-socket in case of inet sockets if the message doesn't contain one. Created attachment 66916 [details]
Patch to update the cached hostname in syslog-ng on SIGHUP
Is this sufficient to update it on SIGHUP?
I overlooked a static keyword in a function
on my first search.
I've submitted syslog-ng that updates the hostname on SIGHUP to stable. Let me know, what you plan for 10.0. Marius, we should ship this together with the sysconfig update for 10.0. SWAMPID is 2965. Would you please submit patch and the patchinfo file? Submitted package for 10.0 and pachinfo as: /work/src/done/PATCHINFO/syslog-ng.patch.box DISTRIBUTION: 10.0-i386,10.0-ppc,10.0-x86_64 PACKAGE: syslog-ng PACKAGER: mt@suse.de BUGZILLA: 116466 SWAMPID: 2965 CATEGORY: recommended DESCRIPTION: This update fixes the following problems: - Syslog-ng continued to use old hostname after it was changed by dhcp. Fixed syslog-ng to update its cached hostname on SIGHUP (reload). DESCRIPTION_DE: Dieses Update behebt folgende Probleme: - Syslog-ng verwendete weiterhin den alten Hostnamen, nachdem ein neuer von dhcp gesetzt wurde. Syslog-ng liest den Hostnamen nun beim SIGUP (reload) neu ein. There is a typo in the german description: 'SIGUP' released This is an autogenerated message for OBS integration: This bug (116466) was mentioned in https://build.opensuse.org/request/show/672696 15.1 / syslog-ng |