package/mysql: add MYSQL_SOCKET variable
PATCH 1/2 package/mysql: add MYSQL_SOCKET variable
Add MYSQL_SOCKET variable with default socket location for other packages to use.
--- package/mysql/mysql.mk | 3 +++ 1 file changed, 3 insertions(+)
package/mysql/mysql.mk +3 -0
@@ -14,6 +14,9 @@ MYSQL_AUTORECONF = YES MYSQL_LICENSE = GPLv2 MYSQL_LICENSE_FILES = README COPYING +# Variable with default socket location for other buildroot packages to use +MYSQL_SOCKET = /tmp/mysql.sock + MYSQL_CONF_ENV = \ ac_cv_sys_restartable_syscalls=yes \ ac_cv_path_PS=/bin/ps \
Signature · 1 line
2.7.4
PATCH 2/2 package/php: Set MySQL socket path
If the buildroot MySQL server is being build set the PHP default MySQL socket path to match what the server is using.
--- package/php/php.mk | 7 +++++++ 1 file changed, 7 insertions(+)
package/php/php.mk +7 -0
@@ -210,6 +210,13 @@ PHP_DEPENDENCIES += unixodbc endif endif +ifneq ($(BR2_PACKAGE_PHP_EXT_MYSQLI)$(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),) +ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y) +# Set default MySQL unix socket to what the MySQL server is using by default +PHP_CONF_OPTS += --with-mysql-sock=$(MYSQL_SOCKET) +endif +endif + define PHP_DISABLE_PCRE_JIT $(SED) '/^#define SUPPORT_JIT/d' $(@D)/ext/pcre/pcrelib/config.h endef
Signature · 1 line
2.7.4
PATCH 1/2 package/mysql: add MYSQL_SOCKET variable
In reply to Floris BosFloris, All,
On 2016-09-08 16:33 +0200, Floris Bos spake thusly:
Quoted 13 lines
Add
MYSQL_SOCKETvariable with default socket location for other packages to use.Signed-off-by Floris Bos <[email protected]>--- package/mysql/mysql.mk | 3 +++ 1 file changed, 3 insertions(+)package/mysql/mysql.mk +0
-0
package/mysql/mysql.mk MYSQL_AUTORECONF = YES · line 18
Quoted 5 lines
package/mysql/mysql.mk +2
-0@@ -14,6 +14,9 @@ MYSQL_AUTORECONF = YES MYSQL_LICENSE = GPLv2 MYSQL_LICENSE_FILES = README COPYING +# Variable with default socket location for other buildroot packages to use +MYSQL_SOCKET = /tmp/mysql.sock
Should we also use that location in the sysv startup script and systemd unit?
If that is the default of mysql, is there a way to force it during configure? I'm a bit uneasy to rely on magic values, in case a future version changes this default location...
Regards,
Yann E. MORIN.
Quoted 10 lines
package/mysql/mysql.mk +0
-0MYSQL_CONF_ENV = \ ac_cv_sys_restartable_syscalls=yes \ ac_cv_path_PS=/bin/ps \Signature · 6 lines
2.7.4 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/2 package/mysql: add MYSQL_SOCKET variable
Quoted 19 lines · Yann E. MORIN
Floris, All,
On 2016-09-08 16:33 +0200, Floris Bos spake thusly:
Quoted 16 lines
Add
MYSQL_SOCKETvariable with default socket location for other packages to use.Signed-off-by Floris Bos <[email protected]>--- package/mysql/mysql.mk | 3 +++ 1 file changed, 3 insertions(+)package/mysql/mysql.mk +0
-0@@ -14,6 +14,9 @@ MYSQL_AUTORECONF = YES MYSQL_LICENSE = GPLv2 MYSQL_LICENSE_FILES = README COPYING
Quoted 8 lines
package/mysql/mysql.mk MYSQL_AUTORECONF = YES · line 18
Quoted 2 lines
package/mysql/mysql.mk +2
-0+# Variable with default socket location for other buildroot packages to use +MYSQL_SOCKET = /tmp/mysql.sockShould we also use that location in the sysv startup script and systemd unit?
If that is the default of mysql, is there a way to force it during configure? I'm a bit uneasy to rely on magic values, in case a future version changes this default location...
Yes, could force it to use that value with a --with-unix-socket-path= configure option or in the server configuration file.
Do note that while /tmp is the upstream default for all MySQL versions, it is naturally not the safest location for multi-user systems. If an unprivileged user gains access to the system sooner than MySQL is up & running, he could create his own /tmp/mysql.sock and intercept authentication details and queries of clients connecting.
So normal Linux distributions would override the default to a different location, e.g. under /var/run
Something we could also consider, if we want to set the socket path anyway.
OTOH do note that the MySQL branch we currently have has been EOL for 3 years, and newer versions uses a totally different (cmake based) build system.
So personally I am not that keen to spend too much time patching up the current package either.
Might be better to create a brand new one for a later MySQL (or MariaDB) version, but that would take some time.
Yours sincerely,
Floris Bos
PATCH 1/2 package/mysql: add MYSQL_SOCKET variable
Hello,
Quoted 6 lines · Floris Bos
Quoted 3 lines
If that is the default of mysql, is there a way to force it during configure? I'm a bit uneasy to rely on magic values, in case a future version changes this default location...
Yes, could force it to use that value with a --with-unix-socket-path= configure option or in the server configuration file.
That would be a good idea.
Quoted 9 lines
Do note that while /tmp is the upstream default for all MySQL versions, it is naturally not the safest location for multi-user systems. If an unprivileged user gains access to the system sooner than MySQL is up & running, he could create his own
/tmp/mysql.sockand intercept authentication details and queries of clients connecting.
So normal Linux distributions would override the default to a different location, e.g. under/var/run
So why not use --with-unix-socket-path=/var/run/mysql.sock ?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/2 package/mysql: add MYSQL_SOCKET variable
Quoted 10 lines · Thomas Petazzoni
Quoted 5 lines · Floris Bos
Quoted 3 lines
If that is the default of mysql, is there a way to force it during configure? I'm a bit uneasy to rely on magic values, in case a future version changes this default location...
Yes, could force it to use that value with a --with-unix-socket-path= configure option or in the server configuration file.
That would be a good idea.
Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Do note that while /tmp is the upstream default for all MySQL versions, it is naturally not the safest location for multi-user systems. If an unprivileged user gains access to the system sooner than MySQL is up & running, he could create his own
/tmp/mysql.sockand intercept authentication details and queries of clients connecting.
So normal Linux distributions would override the default to a different location, e.g. under/var/runSo why not use --with-unix-socket-path=/var/run/mysql.sock ?
Ok, submitted a v2.
Still needs the second PHP part as well.
However someone else would need to check and test the systemd change, as I am never having much luck getting systemd to just work with buildroot. "Timed out waiting for device dev-console.device" this time and no login prompt.
"Dependency failed for Serial Getty on console"
And no easy way to login by SSH either, given "*** automatic network configuration via DHCP is not compatible with networkd ***"
Yours sincerely,
Floris Bos