Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
syslog-ng shows no hostname if it is supplied by dhcp-server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DawgG
l33t
l33t


Joined: 17 Sep 2003
Posts: 866

PostPosted: Thu Jul 16, 2015 10:15 am    Post subject: syslog-ng shows no hostname if it is supplied by dhcp-server Reply with quote

i have some hosts that get their hostname with dhcp only (no /etc/hostname and /etc/conf.d/hostname ist empty; MACs registered on DHCP-server). their syslog-ng is configured to additionally log to a loghost over the network. some new installations show up as (none) on the loghost and the local /var/log/messages-file if the systems boot with the supplied initscripts.

the hostname is only shown if syslog-ng is restarted again after the "normal" system-start; eg:
Code:
Jul 16 11:59:19 (none) root[6793]: blabla
Jul 16 11:59:29 (none) syslog-ng[747]: syslog-ng shutting down; version='3.6.2'
Jul 16 11:59:29 zb-opac-606 syslog-ng[6838]: syslog-ng starting up; version='3.6.2'
Jul 16 11:59:34 zb-opac-606 root[6847]: blabla

what's the reason for this and how can it be fixed? is there a dep missing in some initscript? hostname (that syslog-ng depend on) ist started:

Code:

Jul 16 12:07:12 (none) ntpd[1179]: peer 10.10.1.238 now valid
Jul 16 12:07:16 (none) ntpd[1179]: peer 10.10.1.239 now valid
zb-opac-603 ~ # /etc/init.d/hostname status
 * status: started


when the hostname is set in a static file this does not happen; but even though those hosts are pretty static i want to keep configuring their hostnames with dhcp only.
is there a better way than restarting syslog-ng after system-boot?
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3846
Location: Austro Bavaria

PostPosted: Thu Jul 16, 2015 11:20 am    Post subject: Reply with quote

I am not a specialist

Quote:
is there a better way than restarting syslog-ng after system-boot?


You mean restarting after dhcp figured out who is who.
There may be a way to make it depend on net or something or just generate a rule to restart it.

Yuo need to code it that way that the default settings cause a regular check until you get something else as the default. some sort of timeout to try again.

i talk about hte 169.xx.xx.xx adress range which is asigned by dhcp when the network node is "dead"....

maybe doable with some sort of /etc/init.d/script ...
HAve you checked dhcpcd settins and syslog-ng settings for anything which can be used in this fashion?
Back to top
View user's profile Send private message
DawgG
l33t
l33t


Joined: 17 Sep 2003
Posts: 866

PostPosted: Thu Jul 16, 2015 12:20 pm    Post subject: Reply with quote

Quote:
There may be a way to make it depend on net or something or just generate a rule to restart it.

that was my first thought but it is definitely for a reason that the logger starts way before the net.
i compared this to older installs i have and in those syslog-ng "knows" the hostname straight from the start - that's what bothers me a little bit. the older install is syslog-ng-3.4.8; the new is syslog-ng-3.6.2

i'll test around a little more but will probably go for the cheap way of restarting syslog-ng with /etc/local.d/XX-bla.start - in case logged info on a client from before the network start is needed it will most likely not matter if the hostname in this case is (none).
THX for your input!
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum