Blob Blame History Raw
diff -up mariadb-10.3.11/scripts/galera_new_cluster.sh.p90 mariadb-10.3.11/scripts/galera_new_cluster.sh
--- mariadb-10.3.11/scripts/galera_new_cluster.sh.p90	2018-12-18 17:47:15.963970827 +0100
+++ mariadb-10.3.11/scripts/galera_new_cluster.sh	2018-12-18 17:47:37.917160998 +0100
@@ -22,7 +22,7 @@ EOF
 fi
 
 systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
-    systemctl restart ${1:-mariadb}
+    systemctl restart ${1:-@DAEMON_NAME@}
 
 extcode=$?
 
diff -up mariadb-10.3.11/scripts/mysqld_safe.sh.p90 mariadb-10.3.11/scripts/mysqld_safe.sh
--- mariadb-10.3.11/scripts/mysqld_safe.sh.p90	2018-12-18 17:45:20.907974139 +0100
+++ mariadb-10.3.11/scripts/mysqld_safe.sh	2018-12-18 17:45:20.910974165 +0100
@@ -11,6 +11,12 @@
 # mysql.server works by first doing a cd to the base directory and from there
 # executing mysqld_safe
 
+# we want start daemon only inside "scl enable" invocation
+if ! scl_enabled @SCL_NAME@ ; then
+    echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation"
+    exit 1
+fi
+
 # Initialize script globals
 KILL_MYSQLD=1;
 MYSQLD=
diff -up mariadb-10.5.11-downstream_modified/scripts/mysql_install_db.sh.old mariadb-10.5.11-downstream_modified/scripts/mysql_install_db.sh
--- mariadb-10.5.11-downstream_modified/scripts/mysql_install_db.sh.old	2021-08-24 12:53:01.750421887 +0200
+++ mariadb-10.5.11-downstream_modified/scripts/mysql_install_db.sh	2021-08-24 12:56:28.256855656 +0200
@@ -19,6 +19,12 @@
 #
 # All unrecognized arguments to this script are passed to mysqld.
 
+# we want start daemon only inside "scl enable" invocation
+if ! scl_enabled @SCL_NAME@ ; then
+    echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation"
+    exit 1
+fi
+
 basedir=""
 builddir=""
 ldata="@localstatedir@"
@@ -593,16 +599,16 @@ else
   echo "The problem could be conflicting information in an external"
   echo "my.cnf files. You can ignore these by doing:"
   echo
-  echo "    shell> $0 --defaults-file=~/.my.cnf"
+  echo "    shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $0 --defaults-file=~/.my.cnf'"
   echo
   echo "You can also try to start the mariadbd daemon with:"
   echo
-  echo "    shell> $mysqld --skip-grant-tables --general-log &"
+  echo "    shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $mysqld --skip-grant-tables --general-log &'"
   echo
   echo "and use the command line tool $bindir/mariadb"
   echo "to connect to the mysql database and look at the grant tables:"
   echo
-  echo "    shell> $bindir/mariadb -u root mysql"
+  echo "    shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $bindir/mysql -u root mysql''"
   echo "    MariaDB> show tables;"
   echo
   echo "Try '$mysqld --help' if you have problems with paths.  Using"
@@ -622,10 +628,6 @@ fi
 # the screen.
 if test "$cross_bootstrap" -eq 0 && test -z "$srcdir"
 then
-  s_echo
-  s_echo "To start mariadbd at boot time you have to copy"
-  s_echo "support-files/mariadb.service to the right place for your system"
-
   if test "$auth_root_authentication_method" = normal
   then
     echo
@@ -633,7 +635,7 @@ then
     echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !"
     echo "To do so, start the server, then issue the following command:"
     echo
-    echo "'$bindir/mariadb-secure-installation'"
+    echo "scl enable @SCL_NAME@ -- '$bindir/mysql_secure_installation'"
     echo
     echo "which will also give you the option of removing the test"
     echo "databases and anonymous user created by default.  This is"
@@ -659,8 +661,8 @@ then
     echo "You can start the MariaDB daemon with:"
     echo "cd '$basedir' ; $bindir/mariadb-safe --datadir='$ldata'"
     echo
-    echo "You can test the MariaDB daemon with mysql-test-run.pl"
-    echo "cd '$basedir/@INSTALL_MYSQLTESTDIR@' ; perl mariadb-test-run.pl"
+    echo "after installing @SCL_NAME@-mariadb-test package."
+    echo "See @prefix@/share/mysql-test/README for instructions."
   fi
 
   echo
diff -up mariadb-10.3.11/scripts/mysql.service.in.p90 mariadb-10.3.11/scripts/mysql.service.in
--- mariadb-10.3.11/scripts/mysql.service.in.p90	2018-12-18 17:45:20.909974156 +0100
+++ mariadb-10.3.11/scripts/mysql.service.in	2018-12-18 17:45:20.910974165 +0100
@@ -40,14 +40,20 @@ Type=notify
 User=mysql
 Group=mysql
 
-ExecStartPre=@libexecdir@/mysql-check-socket
+# Load collections set to enabled for this service
+EnvironmentFile=@SCL_SCRIPTS@/service-environment
+
+# We want to start server only inside "scl enable" invocation
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@
+
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket
 # '%n' expands to 'Full unit name'; man systemd.unit
-ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir %n
 # MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
 # Note: we set --basedir to prevent probes that might trigger SELinux alarms,
 # per bug #547485
-ExecStart=@libexecdir@/mysqld --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
-ExecStartPost=@libexecdir@/mysql-check-upgrade
+ExecStart=@libexecdir@/mysqld-scl-helper enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysqld --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
+ExecStartPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade
 
 # Setting this to true can break replication and the Type=notify settings
 # See also bind-address mysqld option.
diff -up mariadb-10.3.11/scripts/mysql@.service.in.p90 mariadb-10.3.11/scripts/mysql@.service.in
--- mariadb-10.3.11/scripts/mysql@.service.in.p90	2018-12-18 17:45:20.909974156 +0100
+++ mariadb-10.3.11/scripts/mysql@.service.in	2018-12-18 17:45:20.910974165 +0100
@@ -47,13 +47,19 @@ Type=notify
 User=mysql
 Group=mysql
 
-ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
-ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
+# Load collections set to enabled for this service
+EnvironmentFile=@SCL_SCRIPTS@/service-environment
+
+# We want to start server only inside "scl enable" invocation
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@
+
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
 # MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
 # Note: we set --basedir to prevent probes that might trigger SELinux alarms,
 # per bug #547485
-ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
-ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
+ExecStart=@libexecdir@/mysqld-scl-helper enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
+ExecStartPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
 
 # Setting this to true can break replication and the Type=notify settings
 # See also bind-address mysqld option.