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