Output MySQL logs to syslog In the chroot environment
I have been learning nodejs and angularjs over the past few months. I am still working on front-end development. I will share some experiences later.
One problem we encountered in the past two days is that after our product is provided to the customer, the customer needs to manage the logs in a unified manner. MySQL needs to output the logs to syslog in my. configure syslog in the [mysqld_safe] section of cnf. However, after modification, it is found that the service fails to start and there is no log. After several surveys, you still need to do the following:
1. Copy/bin/logger to chroot jail during chroot MySQL. Because logger is the shell Interface of syslog, syslog cannot be called without the executable file of logger.
2. generally, logger sends logs to the/dev/log socket, but in the chroot environment, jail cannot access external files, therefore, you need to configure the log socket file in chroot jail by modifying/etc/sysconfig/syslog and changing SYSLOGD_OPTIONS
SYSLOGD_OPTIONS = "-m 0-a/var/chroot/mysql/dev/log"
Man says this:
-A socket
Using this argument you can specify additional sockets from that syslogd has to listen to. This is needed if you're going to let some
Daemon run within a chroot () environment. You can use up to 19 additional sockets.
Okay. Restart syslog. MySQL logs are output to/var/log/daemon by default. the log file is in the/var/chroot/mysql/dev directory.
Above, passed the test in CentOS 5.9
-------------------------------------- Split line --------------------------------------
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: