/etc/hosts: What is loghost? (fresh install of Solaris 10 update 9)
Posted
by
cjavapro
on Server Fault
See other posts from Server Fault
or by cjavapro
Published on 2010-12-28T21:42:32Z
Indexed on
2010/12/28
22:55 UTC
Read the original article
Hit count: 234
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
XX.XX.XX.XX myserver loghost
What is the purpose of loghost
? If it was not for having loghost
in there, all the /etc/hosts
files on all the servers in this particular network could be identical.
Edit: I looked at /etc/syslog.conf
#ident "@(#)syslog.conf 1.5 98/12/14 SMI" /* SunOS 5.0 */
#
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
# syslog configuration file.
#
# This file is processed by m4 so be careful to quote (`') names
# that match m4 reserved words. Also, within ifdef's, arguments
# containing commas must be quoted.
#
*.err;kern.notice;auth.notice /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages
*.alert;kern.err;daemon.err operator
*.alert root
*.emerg *
# if a non-loghost machine chooses to have authentication messages
# sent to the loghost machine, un-comment out the following line:
#auth.notice ifdef(`LOGHOST', /var/log/authlog, @loghost)
mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost)
#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(`LOGHOST', ,
user.err /dev/sysmsg
user.err /var/adm/messages
user.alert `root, operator'
user.emerg *
)
Very interesting. when shutting down,, alerts go to all users probably through *.emerg *
Looking at ifdef
, it seems that the first parameter checks to see if current machine is a loghost, second parameter is what to do if it is and third parameter is what to do if it is not.
Edit: If you want to test a logging rule you can use svcadm restart system-log
to restart the logging service and then logger -p notice "test"
to send a test log message where notice
can be replaced with any type such as user.err
, auth.notice
, etc.
© Server Fault or respective owner