syslog不存在!


10

我使用14.04,但没有syslog。

我是Linux的新用户,多年来一直是Windows用户。当我尝试tail syslog时,结果如下:

henrique@henrique:/var/log$ tail -f /var/log/syslog
tail: couldn't open “/var/log/syslog” for reading: File or directory not found

在安装Ubuntu时是否存在一些错误?这样可以“安装”系统日志吗?

编辑:

cat /etc/rsyslog.conf

#  /etc/rsyslog.conf    Configuration file for rsyslog.
#
#           For more information see
#           /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
#  Default logging rules can be found in /etc/rsyslog.d/50-default.conf


#################
#### MODULES ####
#################

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support
#$ModLoad immark  # provides --MARK-- message capability

# provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514

# provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514

# Enable non-kernel facility klog messages
$KLogPermitNonKernelFacility on

###########################
#### GLOBAL DIRECTIVES ####
###########################

#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# Filter duplicated messages
$RepeatedMsgReduction on

#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog

#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog

#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf

输出为 apt-cache policy inetutils-syslog

inetutils-syslogd:
  Installed: (nenhum)
  Candidate: 2:1.9.2-1
  Version table:
     2:1.9.2-1 0
     500 http://br.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

输出为 apt-cache policy rsyslog

rsyslog:
  Installed: (none)
  Candidate: 7.4.4-1ubuntu2.6
  Version table:
     7.4.4-1ubuntu2.6 0
     500 http://br.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     7.4.4-1ubuntu2.3 0
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     7.4.4-1ubuntu2 0
        500 http://br.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

输出为 sudo service rsyslog status

rsyslog stop/waiting

1
此日志和其他几个日志应由脚本控制/etc/rsyslog.conf。您能否浏览一下该脚本,并告诉我们那里的syslog是否已禁用。或将整个文件发布到paste.ubuntu.com,我们可以看看。另外syslog需要sudo才能查看,请尝试使用sudo相同的命令。
Sergiy Kolodyazhnyy 2015年

@Serg tail -f / var / log / syslog不需要sudo来查看。
Rinzwind

编辑您的问题,并添加apt-cache policy inetutils-syslogd
AB

在我的系统上显示“未安装”,但系统日志处于活动状态;)
Rinzwind

@Rinzewind真的是rsyslogd吗?
AB

Answers:


6

输出的apt-cache policy rsyslog说,rsyslog是不是安装在系统上,因此

sudo apt-get install rsyslog

是的,现在打开了!非常感谢您的帮助。
Henrique Ramos

现在我有了syslog :)我认为它已预先安装在Ubuntu中。在日志安装或配置中我有什么需要做的吗?
Henrique Ramos

不,没有其他事情要做。
AB
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.