]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Starting to implement the mariadb rpm
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 23 Jun 2025 17:42:12 +0000 (13:42 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Mon, 23 Jun 2025 17:42:12 +0000 (13:42 -0400)
conf/mailleur.conf
support/crdb.sh
support/starting.sh

index d11aa2a73658d9143b5f2c959a8206a92c367d1b..c2f654e0afa364b3e6676215536d562e836386f6 100644 (file)
@@ -34,7 +34,7 @@ CA_VERIFY_CLT=0       #to check PEER/server remote certificate
 #------------------------------------------------
 #Configured for Postgresql database
 #DB_TYPE can be either POSTGRESQL,MYSQL, default POSTGRESQL
-DB_TYPE=POSTGRESQL
+DB_TYPE=TO_BE_DEFINED
 DB_NAME=mailleur
 DB_HOST=localhost
 DB_PORT=5432
index 66388ac42536dd173407afa333a3dc52fc9df7a9..05a92f329213b672027f03d75e712d9b8fd8a0b5 100755 (executable)
@@ -24,9 +24,28 @@ LOG=/etc/$APPNAME/dbinst.log
 USER=`id -nu`
 #building data_base
 case "$DB_TYPE" in 
-  "MYSQL"      )
+  "TO_BE_DEFINED"      )
+    echo "Data base type is NOT set within mailleur.conf"
+    exit 1
     ;;
-  "POSTGRESQL" )
+  "MYSQL"              )
+    SQL="mysqld"
+    /etc/rc.d/init.d/mysql stop
+    #grabbing temporary control on the MySQL daemo
+    /usr/bin/mysqld_safe -u root --skip-grant-tables >> $LOG 2>&1
+    sleep 5    #give time to daemon to start
+    (
+    echo "CREATE TABLE user_bck AS (SELECT * FROM user);"
+    echo "UPDATE user SET Password=NULL WHERE User='root' AND Host='localhost';"
+    ) | mysql -u root mysql >> $LOG
+    (
+    echo "Shutdown mysqld skip-grant-tables mode" 
+    /usr/bin/mysqladmin -u root shutdown
+    echo "starting mysqld daemon" 
+    /etc/rc.d/init.d/mysqld start
+    )>> 
+    ;;
+  "POSTGRESQL"         )
     SQL="psql -q"
     /etc/rc.d/init.d/postgresql status
     if [ $? != 0 ] ; then
index d23b558df589dcb7272deecc87ff87734c734844..b358fbc208dfe428a952e5d013b44a821e1fac84 100755 (executable)
@@ -114,10 +114,9 @@ do_mkdb()
 
 {
 case "$DB_TYPE" in
-  "MYSQL"              )
-    ;;
+  "MYSQL"              |               \
   "POSTGRESQL"         )
-    /usr/lib/$APPNAME/support/crdb.sh "/"
+    /usr/lib/$APPNAME/support/crdb.sh 
      if [ $? != 0 ] ; then
        exit -1
        fi