Output MySQL logs to syslog in a chroot environment

Source: Internet
Author: User
Tags syslog

Long time no blog, these months have been learning Nodejs,angularjs, do some front-end development, at present or learning stage, and some experience to share.

One of the problems encountered in these two days is that our products to customers, customers to unified management log, MySQL to the log output to the syslog, you need to configure syslog in the [Mysqld_safe] segment of MY.CNF. However, after the modification of the discovery service failed to start, and there is no log, after several investigations, but also to do the following things:

1. chroot MySQL need to copy the/bin/logger to Chroot jail, because logger is the syslog shell interface, no logger executable file, can not call the Syslog

2. Usually, logger do is to send the log to/dev/log this socket, but in chroot environment, jail inside is not access to the outside of the file, so in chroot jail configuration log socket file, the method is to modify/ Etc/sysconfig/syslog, change syslogd_options to

Syslogd_options= "-M 0-a/var/chroot/mysql/dev/log"

Men (man) say this:

-A socket
Using This argument you can specify additional sockets from that syslogd have to listen to. This is needed if you ' re going-let some
Daemon run within a chroot () environment. You can use up to additional sockets.


OK, the log for restarting Syslog,mysql is output to the/var/log/daemon.log file by default, and you can see the log socket file in the/var/chroot/mysql/dev directory.

Above, tested in CentOS 5.9 through

Output MySQL logs to syslog in a chroot environment

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.