======================= # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License, Version 1.0 only # (the "License"). You may not use this file except in compliance # with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # #ident "@(#)syslog.conf 1.6 05/06/08 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 * mail.* -/var/log/maillog
# 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)
# # 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 * )
bash-3.2# syslogd -d main(1): Started at time Sat Mar 26 18:08:58 2011 hnc_init(1): hostname cache configured 2037 entry ttl:1200 getnets(1): found 1 addresses, they are: ::.2.2 getnets(1): found 1 addresses, they are: 0.0.0.0.2.2 cfline(1): (*.err;kern.notice;auth.notice /dev/sysmsg) cfline(1): (*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages) cfline(1): (*.alert;kern.err;daemon.err operator) cfline(1): (*.alert root) cfline(1): (*.emerg *) cfline(1): (mail.debug @loghost) logerror(1): syslogd: line 45: WARNING: loghost could not be resolved logerror_to_console(1): syslogd: line 45: WARNING: loghost could not be resolved cfline(1): (user.err /dev/sysmsg) cfline(1): (user.err /var/adm/messages) cfline(1): (user.alert root, operator) cfline(1): (user.emerg *)
syslogd: version 1.111 Started: Sat Mar 26 18:08:58 2011 Input message count: system 0, network 0 # Outputs: 9
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 -------------------------------------------------- 5 3 3 3 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X CONSOLE: /dev/sysmsg 7 3 2 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X FILE: /var/adm/messages 3 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X USERS: operator 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X USERS: root 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X WALL: X 3 X X X X X X X X X X X X X X X X X X X X X X X CONSOLE: /dev/sysmsg X 3 X X X X X X X X X X X X X X X X X X X X X X X FILE: /var/adm/messages X 1 X X X X X X X X X X X X X X X X X X X X X X X USERS: root, operator X 0 X X X X X X X X X X X X X X X X X X X X X X X WALL:
发布评论
评论(9)
重启一下syslogd进程
syslog.conf还在吧
#ps -ef|grep syslogd
root 397 1 0 15:01:41? 0:00 /usr/sbin/syslogd
root 691 695 0 16:56:19 pts/2 0:00 grep syslogd
syslogd是否运行正常?
另
/etc/syslog.conf:
=======================
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#ident "@(#)syslog.conf 1.6 05/06/08 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 *
mail.* -/var/log/maillog
# 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 *
)
/var/adm/messages还有记录内容呀,说明syslogd是正常的,但是syslog为啥没有内容呢
maillog也没有内容
bash-3.2# syslogd -d
main(1): Started at time Sat Mar 26 18:08:58 2011
hnc_init(1): hostname cache configured 2037 entry ttl:1200
getnets(1): found 1 addresses, they are: ::.2.2
getnets(1): found 1 addresses, they are: 0.0.0.0.2.2
cfline(1): (*.err;kern.notice;auth.notice /dev/sysmsg)
cfline(1): (*.err;kern.debug;daemon.notice;mail.crit /var/adm/messages)
cfline(1): (*.alert;kern.err;daemon.err operator)
cfline(1): (*.alert root)
cfline(1): (*.emerg *)
cfline(1): (mail.debug @loghost)
logerror(1): syslogd: line 45: WARNING: loghost could not be resolved
logerror_to_console(1): syslogd: line 45: WARNING: loghost could not be resolved
cfline(1): (user.err /dev/sysmsg)
cfline(1): (user.err /var/adm/messages)
cfline(1): (user.alert root, operator)
cfline(1): (user.emerg *)
syslogd: version 1.111
Started: Sat Mar 26 18:08:58 2011
Input message count: system 0, network 0
# Outputs: 9
------------------------ priority = [file, facility] ------------------------
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
--------------------------------------------------
5 3 3 3 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X CONSOLE: /dev/sysmsg
7 3 2 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X FILE: /var/adm/messages
3 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X USERS: operator
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 X USERS: root
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X WALL:
X 3 X X X X X X X X X X X X X X X X X X X X X X X CONSOLE: /dev/sysmsg
X 3 X X X X X X X X X X X X X X X X X X X X X X X FILE: /var/adm/messages
X 1 X X X X X X X X X X X X X X X X X X X X X X X USERS: root, operator
X 0 X X X X X X X X X X X X X X X X X X X X X X X WALL:
Facilities:
[00] kern: 0
[01] user: 8
[02] mail: 16
[03] daemon: 24
[04] auth: 32
[05] security: 32
[06] mark: 192
[07] syslog: 40
[08] lpr: 48
[09] news: 56
[10] uucp: 64
[11] audit: 104
[12] cron: 120
[13] local0: 128
[14] local1: 136
[15] local2: 144
[16] local3: 152
[17] local4: 160
[18] local5: 168
[19] local6: 176
[20] local7: 184
Priorities:
[00] panic: 0
[01] emerg: 0
[02] alert: 1
[03] crit: 2
[04] err: 3
[05] error: 3
[06] warn: 4
[07] warning: 4
[08] notice: 5
[09] info: 6
[10] debug: 7
[11] none: 16
Per File Statistics
File Tot Dups Nofwd Errs
---- --- ---- ----- ----
/dev/sysmsg 0 0 0 0
/var/adm/messages 0 0 0 0
operator 0 0 0 0
root 0 0 0 0
WALL 0 0 0 0
/dev/sysmsg 0 0 0 0
/var/adm/messages 0 0 0 0
root,operator 0 0 0 0
WALL 0 0 0 0
logerror(1): syslogd: syslogd pid 397 already running. Cannot start another syslogd pid 730
记录就正常了?
logerror(1): syslogd: line 45: WARNING: loghost could not be resolved
logerror_to_console(1): syslogd: line 45: WARNING: loghost could not be resolved
查查
logerror(1): syslogd: line 45: WARNING: loghost could not be resolved
45行是:
mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost)