• Otto Kekäläinen's avatar
    MDEV-33750: Make SysV init more verbose in case of MariaDB start failures · af124c4f
    Otto Kekäläinen authored
    MariaDB installs/upgrades in Docker containers (and elsewhere where
    systemd is not used) occasionally fail with output like:
    
      Starting MariaDB database server: mariadbd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
      invoke-rc.d: initscript mariadb, action "start" failed.
      dpkg: error processing package mariadb-server-10.5 (--configure):
       installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 1
    
    This is not very helpful. Thus extend the init script to try the server
    start/restart one more time but with error log defined separately,
    and then print out the error log contents of this single start attempt.
    
      ...
      Starting MariaDB database server: mariadbd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
      230103 01:06:48 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
      230103 01:06:48 mysqld_safe Logging to '/tmp/tmp.JlE4sdUMZz.err'.
      230103 01:06:49 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
      Running '/etc/init.d/mariadb start' failed with error log:
      230103 01:06:49 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
      2023-01-03  1:06:49 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-0+deb11u1) starting as process 10417 ...
      2023-01-03  1:06:49 0 [Note] InnoDB: Uses event mutexes
      2023-01-03  1:06:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2023-01-03  1:06:49 0 [Note] InnoDB: Number of pools: 1
      2023-01-03  1:06:49 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
      2023-01-03  1:06:49 0 [Note] InnoDB: Using Linux native AIO
      2023-01-03  1:06:49 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
      2023-01-03  1:06:49 0 [Note] InnoDB: Completed initialization of buffer pool
      2023-01-03  1:06:49 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
      ...
    af124c4f
mariadb-server.mariadb.init 8.22 KB