ps_tokudb_admin emits "This script must be run as root"

Bug #1682419 reported by Nickolay Ihalainen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Confirmed
Undecided
EvgeniyPatlan
5.7
Fix Released
Undecided
EvgeniyPatlan

Bug Description

It's a good idea to run whole docker entry point as user:
https://github.com/percona/percona-docker/blob/master/percona-server/Dockerfile#L55

https://github.com/ihanick/docker-percona-server-tokudb
If I try to I'm installing percona-server-tokudb-5.7 package and running container with -e INIT_TOKUDB=1

ps_tokudb_admin complains:
ERROR: This script must be run as root!

and after disabling this check:
/usr/bin/ps_tokudb_admin: line 507: /etc/mysql/my.cnf: Permission denied
ERROR: Failed to add thp-setting=never option into /etc/mysql/my.cnf

I've disabled both checks in my repository:
--- ps_tokudb_admin.orig 2017-04-03 11:35:45.000000000 +0300
+++ ps_tokudb_admin 2017-04-13 06:03:42.466195622 +0300
@@ -149,7 +149,7 @@ done
 # Make sure only root can run this script
 if [ $(id -u) -ne 0 ]; then
   echo "ERROR: This script must be run as root!" 1>&2
- exit 1
+ #exit 1
 fi

 if [ $ENABLE = 1 -a $DISABLE = 1 ]; then
@@ -312,6 +312,7 @@ if [ $ENABLE = 1 -o $DISABLE = 1 ]; then
   if [ $FULL_SYSTEMD_MODE = 0 ]; then
     printf "Checking if thp-setting=never option is already set in config file...\n"
     STATUS_THP_MYCNF=$($MYSQL_DEFAULTS_BIN mysqld_safe $DEFAULTS_FILE_OPTION|grep -c thp-setting=never)
+ STATUS_THP_MYCNF=1
     if [ $STATUS_THP_MYCNF = 0 ]; then
       printf "INFO: Option thp-setting=never is not set in the config file.\n"
       printf " (needed only if THP is not disabled permanently on the system)\n\n"

Desired behavior:
Do not fail tokudb installation if thp settings already madvise|never.
Settings could be changed on host, outside container.
TokuDB could be installed and started as user without write permissions for /etc/*my.cnf

Tags: pkg
Changed in percona-server:
assignee: nobody → EvgeniyPatlan (evgeniy-patlan)
Revision history for this message
EvgeniyPatlan (evgeniy-patlan) wrote :

This is already known issue. I'm working on it

Changed in percona-server:
status: New → Confirmed
Revision history for this message
EvgeniyPatlan (evgeniy-patlan) wrote :

This is already fixed. Now it is possible to run docker with tockudb

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3685

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.