Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/8] package/mariadb: fix permissions of data dir when using systemd
@ 2020-02-04  1:21 Ryan Coe
  2020-02-04  1:21 ` [Buildroot] [PATCH v3 2/8] package/mariadb: remove mariadb_config from target Ryan Coe
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Ryan Coe @ 2020-02-04  1:21 UTC (permalink / raw)
  To: buildroot

mysql_install_db is currently called in the systemd unit without
--user=mysql that the sysv script uses. This will generate the initial
database files with root permissions. However, mysqld runs as user mysql
so this will cause problems. We fix this by calling chown instead of
passing the user parameter because an upcoming version bump will fail when
ran this way.

Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
---
Changes v2 -> v3:
  - separate changes into separate patches (suggested by Thomas)
Changes v1 -> v2:
  - no change
---
 package/mariadb/mysqld.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/mariadb/mysqld.service b/package/mariadb/mysqld.service
index cd308310c6..3eaef173e1 100644
--- a/package/mariadb/mysqld.service
+++ b/package/mariadb/mysqld.service
@@ -2,7 +2,7 @@
 Description=MySQL database server
 
 [Service]
-ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql'
+ExecStartPre=/bin/sh -c 'test "`ls -1 /var/lib/mysql | wc -l`" != "0" || mysql_install_db --basedir=/usr --datadir=/var/lib/mysql && chown -R mysql:mysql /var/lib/mysql'
 ExecStart=/usr/bin/mysqld_safe
 Restart=always
 User=mysql
-- 
2.25.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-03-10 20:30 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-04  1:21 [Buildroot] [PATCH v3 1/8] package/mariadb: fix permissions of data dir when using systemd Ryan Coe
2020-02-04  1:21 ` [Buildroot] [PATCH v3 2/8] package/mariadb: remove mariadb_config from target Ryan Coe
2020-02-04 13:38   ` Peter Korsgaard
2020-03-10 20:30   ` Peter Korsgaard
2020-02-04  1:21 ` [Buildroot] [PATCH v3 3/8] package/mariadb: add sysroot path to mariadb_config Ryan Coe
2020-02-04 13:45   ` Peter Korsgaard
2020-02-04  1:21 ` [Buildroot] [PATCH v3 4/8] package/mariadb: fix potential error message in sysv startup script Ryan Coe
2020-02-04 13:48   ` Peter Korsgaard
2020-03-10 20:30   ` Peter Korsgaard
2020-02-04  1:21 ` [Buildroot] [PATCH v3 5/8] package/mariadb: rename variable " Ryan Coe
2020-02-04 13:52   ` Peter Korsgaard
2020-02-04  1:21 ` [Buildroot] [PATCH v3 6/8] package/mariadb: explicitly define logging directory to mysqld Ryan Coe
2020-02-04 13:54   ` Peter Korsgaard
2020-02-04  1:21 ` [Buildroot] [PATCH v3 7/8] package/mariadb: do not pass --user=mysql to mysql_install_db Ryan Coe
2020-02-04 13:55   ` Peter Korsgaard
2020-02-04  1:22 ` [Buildroot] [PATCH v3 8/8] package/mariadb: security bump version to 10.4.12 Ryan Coe
2020-02-04 14:02   ` Peter Korsgaard
2020-02-04 13:38 ` [Buildroot] [PATCH v3 1/8] package/mariadb: fix permissions of data dir when using systemd Peter Korsgaard
2020-03-07 21:23 ` Peter Korsgaard
2020-03-08  8:39   ` Baruch Siach
2020-03-08  8:52     ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox