Add MYSQL_SOCKET variable with MySQL socket location
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
# mysqld runs as user mysql, but /run is only writable by root
# so create a subdirectory for mysql.
- install -d -o mysql -g root -m 0700 /run/mysql
+ install -d -o mysql -g root -m 0755 /run/mysql
# We don't use start-stop-daemon because mysqld has
# its own wrapper script.
MYSQL_LICENSE = GPLv2
MYSQL_LICENSE_FILES = README COPYING
+# Unix socket. This variable can also be consulted by other buildroot packages
+MYSQL_SOCKET = /run/mysql/mysql.sock
+
MYSQL_CONF_ENV = \
ac_cv_sys_restartable_syscalls=yes \
ac_cv_path_PS=/bin/ps \
--without-readline \
--with-low-memory \
--enable-thread-safe-client \
+ --with-unix-socket-path=$(MYSQL_SOCKET) \
--disable-mysql-maintainer-mode
# host-mysql only installs what is needed to build mysql, i.e. the
ExecStartPre=/bin/sh -c 'test -d /var/mysql/mysql || mysql_install_db --user=mysql --ldata=/var/mysql'
ExecStart=/usr/bin/mysqld_safe
Restart=always
+User=mysql
+RuntimeDirectory=mysql
+RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target