Daily management of the CentOS Linux system 3 16th session

Source: Internet
Author: User
Tags syslog rsyslog

Daily management of the CentOS Linux system 3 16th session

The first half of the class

The second half of the class

Linux system service Management



Ntsysv
Tool NTSYSV similar to the graphical interface management tool, if you do not have the command install Yum install-y ntsysv
Common services: Crond, iptables, Network, sshd, Syslog, Irqbalance, SendMail, Microcode_ctl
Need reboot to take effect after saving

chkconfig (Command Line Service Administration tool)

List of services: chkconfig--list


Off Level 2: chkconfig--level 2 atd off
Multiple levels, off 2, Level 3: chkconfig--level ATD off
List ATD Services: chkconfig--list ATD
On/off 3,4,5 level: chkconfig--level [345] ServiceName on/off
The default is Level 3: chkconfig atd off; chkconfig ATD on

Chkconfig--add/del ServiceName


Adding Custom Services

cd/etd/init.d/VI// add chkconfig in script 345 95 5 345 Refer to default 345 boot level, 95 on, 5 off specify open and close order CP // copy startup script Lin to/etd/init.d/directory chkconfig-add Linchmod755// increase script execution permissions chkconfig--list aming

View the start/close order of each service script s,k: ls /etc/rc.d/rc3.d/

Change the start order of the service in the configuration file and restart the server reboot: vi /etc/init.d/crond

CENTOS6 default to Rsyslog.conf before version is syslog.conf. The main information for this profile is: What services are logged and what level of information needs to be logged.

Log format:
Log generated by Auth–pam
Verification information for login information such as Authpriv–ssh,ftp
cron– Time Task related
kern– kernel
lpr– Printing
mail– Mail
Mark (syslog) –rsyslog service internal information, time identification
news– News Group
user– related information generated by the user program
Uucp–unix to UNIX copy, related communication between UNIX hosts
Local 1~7– custom log device

Log level:
debug– with modal information, most log information
info– General Information log, most commonly used
notice– information on the most important general conditions
warning– Warning Level
err– error level, information that prevents a feature or module from working correctly
crit– critical level that prevents the entire system or the entire software from working properly information
alert– information that needs to be modified immediately
emerg– critical information such as kernel crashes
None – don't record anything.
From top to bottom, the level is low to high, and the information recorded is getting less


Connection symbols
. XXX: Indicates information greater than or equal to XXX level
. =XXX: Represents information equal to XXX level
.! XXX: Information indicating the level outside of XXX

/etc/rsyslog.conf # # # # RULES # # *       $# Log All kernel messages to the console. Panax Notoginseng# Logging MuchElseClutters up the screen .  -#kern. */dev/Console the       +# Log anything (except mail) of the levelInfoor higher.  A# Don'T Log private authentication messages!      the*.Info; mail.none;authpriv.none;cron.none/var/log/messages Almost all information is recorded to/var/log/messages +       -# The Authprivfilehas restricted access.  $authpriv.*/var/log/Secure $       -# Log all the mail messagesinchOne place .  -Mail.*-/var/log/Maillog the       -      Wuyi# Log Cron Stuff theCron.*/var/log/Cron -       Wu# Everybody gets emergency messages -*.emerg * About       $# Save News errors of level crit and higherinchA specialfile.  -uucp,news.crit/var/log/Spooler -       -# Save Boot messages also to Boot.log Alocal7.*/var/log/boot.log

F

Daily management of the CentOS Linux system 3 16th session

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.