linux daemon configuration file

Daemon is a program running in non-interactive mode. In general, the daemon task of networking and related areas: they are waiting for a connection, in order to provide services through the connection. You can use a lot of Linux daemon from the Web server to ftp server.

/etc/syslog.conf

syslogd is a daemon, which is responsible for recording (written to disk) to send messages to other programs from the system. In particular, this service is often used by some daemons, the daemons do not have another way to send a signal or may have problems sending messages to users.

1. File Format

is /etc/syslog.conf syslog daemon configuration file .syslog daemon provides a mature client to record a message from a program running on the system - server mechanism. syslog daemon or receive messages from the program, in accordance with the priority and type of message classification, and according to the rules configured by the administrator will be written into the log. The result is a robust and unified log management method.

This file consists of a section of the rules of composition. Each rule should be written in a single line. However, if a line ending with a backslash \, then his next physical line will be considered to belong to the same line with this line. Blank lines and # about to start are ignored.

Each rule is this form below:

facility.priority[;facility.priority .....] action

Separation between the facility and the priority with a periods. They are collectively referred selector. Each rule can have multiple selector, separated by semicolons selector. And then separated by a space or tab between the selector and action.

syslog facility designated functions, including the following:

auth certification activities by the pam_pwdb report.

authpriv including privileged information such as user name, including the certification activities

cron cron and information relating to the at.

information relating to the inetd daemon daemon.

kern kernel information, transmitted through the first klogd.

Information about lpr and print services.

For information about the mail and e-mail

mark syslog internal function for generating a time stamp

news information from the news server

Syslog information generated by the syslog

User information generated by the user program

Information generated by uucp uucp

local0 ---- local7 and use a custom program, such as using ssh functions as local5

* Wildcard to represent all functions other than the mark

priority specified priority of the message. corresponding to each of the priority function is arranged in a certain order, the most advanced emerg, followed Alert, and so on. By default, specified in /etc/syslog.conf record level for this level and higher. If you want to use to determine the level of operations you can use two symbols! (Unequal) and =.

user.=info

It represents inform syslog accept all user functions on the info-level information.

Available syslog priorities are as follows:

emerg panic or the system is not available

alert conditions need to be modified immediately

crit error conditions prevent certain tools or subsystem functions implemented

Err error conditions prevent tools or certain subsystems some functions to achieve

warning early warning information

notice the importance of having a common condition

info information message

debug information does not include other conditions or function problems

none no significant grade, typically used for troubleshooting

* All levels, except none

Activities represented action field having a lot of flexibility, in particular, the name can be used to make the pipe role is to generate syslogd post processing information.

syslog mainly supports the following action

file

The absolute path of the specified file, such as:. / Var / log / messages log information is written to this file

terminal 或 printer

Fully parallel or serial device identifier, such as / dev / console. Log information to the device

@host

Remote log server. Log information will be sent to this log server

username

Send a message to the specified user

named pipe

Specify an absolute path using the FIFO mkfifo command to create the file.

If you made changes to this file, you want to make changes to take effect, you need to notify changes to the syslog daemon. It sends a SIGHUP is the right way, you can easily use the killall command to do this:

# killall -HUP syslogd

2.安全性

您应该清楚如果 syslogd 写的日志文件还不存在的话,程序将创建它们。无论您当前的 umask 如何设置,该文件将被创建为可被所有用户读取。如果您关心安全性,那么您应该用 chmod 命令将该文件设置为仅 root 用户可读写。此外,可以用适当的许可权配置 logrotate 程序(在下面描述)以创建新的日志文件。syslog 守护程序始终会保留现有日志文件的当前属性,因此一旦创建了文件,您就不需要担心它。

3.相关命令

logrotate

klogd

syslogd

dmesg

/etc/httpd.conf

Web 服务器 Apache 的配置文件。这个文件一般不在 /etc 中。它可能在 /usr/local/httpd/conf/ 或 /etc/httpd/conf/ 中,但是要确定它的位置,您还需要检查特定的 Apache 安装信息。

/etc/conf.modules or /etc/modules.conf

kerneld 的配置文件。有意思的是,kerneld 并不是“作为守护进程的”内核。它其实是一种在需要时负责“快速”加载附加内核模块的守护进程。

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11109385.html