dpkg: percona-server-server-5.7.postinst fail to find the right MYSQLDATA
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
| 5.5 |
Fix Released
|
High
|
EvgeniyPatlan | ||
| 5.6 |
Fix Released
|
High
|
EvgeniyPatlan | ||
| 5.7 |
Fix Released
|
High
|
EvgeniyPatlan |
Bug Description
On debian jessie, I have :
root@test:~# grep -v '^#' /etc/mysql/my.cnf
!includedir /etc/mysql/
!includedir /etc/mysql/conf.d/
root@test:~# grep datadir /etc/mysql/
/etc/mysql/
root@test:~# grep datadir /etc/mysql/conf.d/*
datadir = /space/mysql
so the right datadir is /space/mysql.
From https:/
If multiple instances of a given option are found, the last instance takes precedence, with one
exception: For mysqld, the first instance of the --user option is used as a security precaution, to
prevent a user specified in an option file from being overridden on the command line.
In /var/lib/
MYSQLDATA=
root@test:~# my_print_defaults mysqld | grep datadir | cut -d= -f2
/var/lib/mysql
/space/mysql
In /var/lib/
[ ! "$(ls -A ${MYSQLDATA})" ]
but :
root@test:~# ls -A /space/mysql
root@test:~# ls -A /var/lib/mysql /space/mysql
/space/mysql:
/var/lib/mysql:
So the test fail even if the datadir is empty.
What I propose :
MYSQLDATA=
root@test:~# my_print_defaults mysqld | grep -- '--datadir=' | tail -n 1 | cut -d= -f2
/space/mysql
--
Regards
Maxime de Roucy (mderoucy) wrote : | #1 |
EvgeniyPatlan (evgeniy-patlan) wrote : Re: [Bug 1705729] Re: dpkg: percona-server-server-5.7.postinst fail to find the right MYSQLDATA | #2 |
in your case datadir should be taken
from /etc/mysql/
file.
On Fri, Jul 21, 2017 at 6:45 PM, Maxime de Roucy <<email address hidden>
> wrote:
> root@test:~# cat /etc/apt/
> deb http://
>
> root@test:~# dpkg -l percona-
> Desired=
> | Status=
> trig-aWait/
> |/ Err?=(none)
> ||/ Name Version
> Architecture Description
> +++-===
> =======
> =======
> =======
> ii percona-
> amd64 Percona Server database server binaries
>
> --
> You received this bug notification because you are a member of Percona
> core, which is subscribed to Percona Server.
> https:/
>
> Title:
> dpkg: percona-
> MYSQLDATA
>
> Status in Percona Server:
> New
>
> Bug description:
> On debian jessie, I have :
>
> root@test:~# grep -v '^#' /etc/mysql/my.cnf
> !includedir /etc/mysql/
> !includedir /etc/mysql/conf.d/
> root@test:~# grep datadir /etc/mysql/
> /etc/mysql/
> root@test:~# grep datadir /etc/mysql/conf.d/*
> datadir = /space/mysql
>
> so the right datadir is /space/mysql.
>
> From https:/
>
> If multiple instances of a given option are found, the last instance
> takes precedence, with one
> exception: For mysqld, the first instance of the --user option is used
> as a security precaution, to
> prevent a user specified in an option file from being overridden on
> the command line.
>
> In /var/lib/
>
> MYSQLDATA=
>
> root@test:~# my_print_defaults mysqld | grep datadir | cut -d= -f2
> /var/lib/mysql
> /space/mysql
>
> In /var/lib/
> if the datadir is empty :
>
> [ ! "$(ls -A ${MYSQLDATA})" ]
>
> but :
>
> root@test:~# ls -A /space/mysql
> root@test:~# ls -A /var/lib/mysql /space/mysql
> /space/mysql:
>
> /var/lib/mysql:
>
> So the test fail even if the datadir is empty.
>
> What I propose :
>
> MYSQLDATA=
> -n 1 | cut -d= -f2)
>
> root@test:~# my_print_defaults mysqld | grep -- '--datadir=' | tail -n
> 1 | cut -d= -f2
> /space/mysql
>
> --
> Regards
>
> To manage notifications about this bug go to:
> https:/
>
> Launchpad-
> Launchpad-Bug: product=
Maxime de Roucy (mderoucy) wrote : | #3 |
@evgeniy-patlan I don't really understand what you mean…
datadir should be extracted as mysqld does, so it should be taken from /etc/my.cnf, /etc/mysql/my.cnf and SYSCONFDIR/my.cnf (cf. https:/
This command does that :
my_print_defaults mysqld
But the rest of the script fail because it doesn't take into account this sentence from the mysql documentation :
If multiple instances of a given option are found, the last instance takes precedence, with one
exception: For mysqld, the first instance of the --user option is used as a security precaution,
to prevent a user specified in an option file from being overridden on the command line.
If the datadir used by the script should be the default one (as you seems to say) why bothering retrieving it from the configuration ? Just use /var/lib/mysql ; as it is the default datadir.
Can you elaborate ?
Regards
Changed in percona-server: | |
assignee: | nobody → Sveta Smirnova (svetasmirnova) |
Sveta Smirnova (svetasmirnova) wrote : | #4 |
Thank you for the report.
Verified as described.
Changed in percona-server: | |
status: | New → Confirmed |
Sveta Smirnova (svetasmirnova) wrote : | #5 |
Versions 5.5 and 5.6 just ignores datadir, specified in the latest configuration file (installs everything into /var/lib/mysql) and 5.7 fails with error.
EvgeniyPatlan (evgeniy-patlan) wrote : | #6 |
here is the commit for ps-57 https:/
EvgeniyPatlan (evgeniy-patlan) wrote : | #7 |
Shahriyar Rzayev (rzayev-sehriyar) wrote : | #8 |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
root@test:~# cat /etc/apt/ sources. list.d/ percona. list repo.percona. com/apt jessie main
deb http://
root@test:~# dpkg -l percona- server- server- 5.7 Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ======= ======= ======= ======= ======= ==-==== ======= ======= ======= ===-=== ======= ======= ======= ====-== ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ====== server- server- 5.7 5.7.18-15-1.jessie amd64 Percona Server database server binaries
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii percona-