root@95f18ae10f8e:/build# export DEBIAN_SCRIPT_DEBUG=1 root@95f18ae10f8e:/build# apt install ./*.deb Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'libmariadb-dev-compat' instead of './libmariadb-dev-compat_10.5.6-2_amd64.deb' Note, selecting 'libmariadb-dev' instead of './libmariadb-dev_10.5.6-2_amd64.deb' Note, selecting 'libmariadb3' instead of './libmariadb3_10.5.6-2_amd64.deb' Note, selecting 'libmariadbd-dev' instead of './libmariadbd-dev_10.5.6-2_amd64.deb' Note, selecting 'libmariadbd19' instead of './libmariadbd19_10.5.6-2_amd64.deb' Note, selecting 'libreadline5' instead of './libreadline5_5.2+dfsg-3+b13_amd64.deb' Note, selecting 'mariadb-backup' instead of './mariadb-backup_10.5.6-2_amd64.deb' Note, selecting 'mariadb-client-10.5' instead of './mariadb-client-10.5_10.5.6-2_amd64.deb' Note, selecting 'mariadb-client-core-10.5' instead of './mariadb-client-core-10.5_10.5.6-2_amd64.deb' Note, selecting 'mariadb-client' instead of './mariadb-client_10.5.6-2_all.deb' Note, selecting 'mariadb-common' instead of './mariadb-common_10.5.6-2_all.deb' Note, selecting 'mariadb-plugin-connect' instead of './mariadb-plugin-connect_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-cracklib-password-check' instead of './mariadb-plugin-cracklib-password-check_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-gssapi-client' instead of './mariadb-plugin-gssapi-client_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-gssapi-server' instead of './mariadb-plugin-gssapi-server_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-mroonga' instead of './mariadb-plugin-mroonga_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-oqgraph' instead of './mariadb-plugin-oqgraph_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-rocksdb' instead of './mariadb-plugin-rocksdb_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-s3' instead of './mariadb-plugin-s3_10.5.6-2_amd64.deb' Note, selecting 'mariadb-plugin-spider' instead of './mariadb-plugin-spider_10.5.6-2_amd64.deb' Note, selecting 'mariadb-server-10.5' instead of './mariadb-server-10.5_10.5.6-2_amd64.deb' Note, selecting 'mariadb-server-core-10.5' instead of './mariadb-server-core-10.5_10.5.6-2_amd64.deb' Note, selecting 'mariadb-server' instead of './mariadb-server_10.5.6-2_all.deb' Note, selecting 'mariadb-test-data' instead of './mariadb-test-data_10.5.6-2_all.deb' Note, selecting 'mariadb-test' instead of './mariadb-test_10.5.6-2_amd64.deb' The following additional packages will be installed: ca-certificates cracklib-runtime file fontconfig-config fonts-dejavu-core galera-4 gawk krb5-locales libaio1 libbrotli1 libc-dev-bin libc-devtools libc6 libc6-dev libcgi-fast-perl libcgi-pm-perl libclone-perl libconfig-inifiles-perl libcrack2 libcrypt-dev libcurl4 libdbd-mariadb-perl libdbi-perl libdeflate0 libencode-locale-perl libevent-2.1-7 libexpat1 libfcgi-bin libfcgi-perl libfcgi0ldbl libfontconfig1 libfreetype6 libgd3 libgdbm-compat4 libgdbm6 libgflags2.2 libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutls30 libgnutlsxx28 libgpm2 libgssapi-krb5-2 libhogweed6 libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libicu67 libidn2-0 libidn2-dev libio-html-perl libjbig0 libjpeg62-turbo libjudydebian1 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common libltdl7 liblwp-mediatypes-perl libmagic-mgc libmagic1 libmpdec3 libmpfr6 libncurses6 libncursesw6 libnettle8 libnghttp2-14 libnsl-dev libnsl2 libodbc1 libp11-kit-dev libp11-kit0 libpcre2-posix2 libperl5.32 libpng16-16 libpopt0 libprocps8 libpsl5 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libreadline8 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsigsegv2 libsnappy1v5 libsqlite3-0 libssh2-1 libssl1.1 libtasn1-6-dev libtasn1-doc libterm-readkey-perl libtiff5 libtimedate-perl libtinfo6 libtirpc-common libtirpc-dev libtirpc3 libunbound8 liburi-perl libwebp6 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxxhash0 linux-libc-dev lsof manpages manpages-dev media-types mysql-common netbase nettle-dev odbcinst odbcinst1debian2 openssl perl perl-base perl-modules-5.32 procps psmisc publicsuffix python3 python3-minimal python3-mysqldb python3.9 python3.9-minimal readline-common rocksdb-tools rsync sensible-utils socat ucf unixodbc wamerican zlib1g-dev Suggested packages: gawk-doc glibc-doc libc-l10n locales libmldbm-perl libnet-daemon-perl libsql-statement-perl libgd-tools gdbm-l10n gmp-doc libgmp10-doc libmpfr-dev dns-root-data gnutls-bin gnutls-doc gpm krb5-doc krb5-user libdata-dump-perl libipc-sharedcache-perl libmyodbc odbc-postgresql tdsodbc unixodbc-bin libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql libwww-perl man-browser mailx netcat-openbsd patch perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make libtap-harness-archive-perl python3-doc python3-tk python3-venv python3-mysqldb-dbg python3.9-venv python3.9-doc binutils binfmt-support readline-doc openssh-client openssh-server Recommended packages: libnss-nis libnss-nisplus The following NEW packages will be installed: ca-certificates cracklib-runtime file fontconfig-config fonts-dejavu-core galera-4 gawk krb5-locales libaio1 libbrotli1 libc-dev-bin libc-devtools libc6-dev libcgi-fast-perl libcgi-pm-perl libclone-perl libconfig-inifiles-perl libcrack2 libcrypt-dev libcurl4 libdbd-mariadb-perl libdbi-perl libdeflate0 libencode-locale-perl libevent-2.1-7 libexpat1 libfcgi-bin libfcgi-perl libfcgi0ldbl libfontconfig1 libfreetype6 libgd3 libgdbm-compat4 libgdbm6 libgflags2.2 libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpm2 libgssapi-krb5-2 libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libicu67 libidn2-dev libio-html-perl libjbig0 libjpeg62-turbo libjudydebian1 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common libltdl7 liblwp-mediatypes-perl libmagic-mgc libmagic1 libmariadb-dev libmariadb-dev-compat libmariadb3 libmariadbd-dev libmariadbd19 libmpdec3 libmpfr6 libncurses6 libncursesw6 libnghttp2-14 libnsl-dev libnsl2 libodbc1 libp11-kit-dev libpcre2-posix2 libperl5.32 libpng16-16 libpopt0 libprocps8 libpsl5 libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libreadline5 libreadline8 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsigsegv2 libsnappy1v5 libsqlite3-0 libssh2-1 libssl1.1 libtasn1-6-dev libtasn1-doc libterm-readkey-perl libtiff5 libtimedate-perl libtirpc-common libtirpc-dev libtirpc3 libunbound8 liburi-perl libwebp6 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxxhash0 linux-libc-dev lsof manpages manpages-dev mariadb-backup mariadb-client mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-plugin-connect mariadb-plugin-cracklib-password-check mariadb-plugin-gssapi-client mariadb-plugin-gssapi-server mariadb-plugin-mroonga mariadb-plugin-oqgraph mariadb-plugin-rocksdb mariadb-plugin-s3 mariadb-plugin-spider mariadb-server mariadb-server-10.5 mariadb-server-core-10.5 mariadb-test mariadb-test-data media-types mysql-common netbase nettle-dev odbcinst odbcinst1debian2 openssl perl perl-modules-5.32 procps psmisc publicsuffix python3 python3-minimal python3-mysqldb python3.9 python3.9-minimal readline-common rocksdb-tools rsync sensible-utils socat ucf unixodbc wamerican zlib1g-dev The following packages will be upgraded: libc6 libgnutls30 libhogweed6 libidn2-0 libnettle8 libp11-kit0 libtinfo6 perl-base 8 upgraded, 167 newly installed, 0 to remove and 53 not upgraded. Need to get 68.7 MB/141 MB of archives. After this operation, 901 MB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 /build/mariadb-common_10.5.6-2_all.deb mariadb-common all 1:10.5.6-2 [35.1 kB] Get:2 /build/libmariadb3_10.5.6-2_amd64.deb libmariadb3 amd64 1:10.5.6-2 [174 kB] Get:3 /build/libreadline5_5.2+dfsg-3+b13_amd64.deb libreadline5 amd64 5.2+dfsg-3+b13 [120 kB] Get:4 /build/mariadb-client-core-10.5_10.5.6-2_amd64.deb mariadb-client-core-10.5 amd64 1:10.5.6-2 [778 kB] Get:5 /build/mariadb-client-10.5_10.5.6-2_amd64.deb mariadb-client-10.5 amd64 1:10.5.6-2 [1488 kB] Get:6 http://deb.debian.org/debian sid/main amd64 perl-base amd64 5.32.1-2 [1629 kB] Get:7 /build/mariadb-server-core-10.5_10.5.6-2_amd64.deb mariadb-server-core-10.5 amd64 1:10.5.6-2 [6598 kB] Get:8 /build/mariadb-server-10.5_10.5.6-2_amd64.deb mariadb-server-10.5 amd64 1:10.5.6-2 [4182 kB] Get:9 /build/libmariadb-dev_10.5.6-2_amd64.deb libmariadb-dev amd64 1:10.5.6-2 [182 kB] Get:10 /build/libmariadb-dev-compat_10.5.6-2_amd64.deb libmariadb-dev-compat amd64 1:10.5.6-2 [33.9 kB] Get:11 /build/libmariadbd19_10.5.6-2_amd64.deb libmariadbd19 amd64 1:10.5.6-2 [4846 kB] Get:12 /build/libmariadbd-dev_10.5.6-2_amd64.deb libmariadbd-dev amd64 1:10.5.6-2 [5996 kB] Get:13 /build/mariadb-backup_10.5.6-2_amd64.deb mariadb-backup amd64 1:10.5.6-2 [6019 kB] Get:14 /build/mariadb-client_10.5.6-2_all.deb mariadb-client all 1:10.5.6-2 [33.5 kB] Get:15 http://deb.debian.org/debian sid/main amd64 perl-modules-5.32 all 5.32.1-2 [2823 kB] Get:16 /build/mariadb-plugin-connect_10.5.6-2_amd64.deb mariadb-plugin-connect amd64 1:10.5.6-2 [486 kB] Get:17 /build/mariadb-plugin-cracklib-password-check_10.5.6-2_amd64.deb mariadb-plugin-cracklib-password-check amd64 1:10.5.6-2 [35.6 kB] Get:18 /build/mariadb-plugin-gssapi-client_10.5.6-2_amd64.deb mariadb-plugin-gssapi-client amd64 1:10.5.6-2 [36.5 kB] Get:19 /build/mariadb-plugin-gssapi-server_10.5.6-2_amd64.deb mariadb-plugin-gssapi-server amd64 1:10.5.6-2 [38.0 kB] Get:20 /build/mariadb-plugin-mroonga_10.5.6-2_amd64.deb mariadb-plugin-mroonga amd64 1:10.5.6-2 [1160 kB] Get:21 /build/mariadb-plugin-oqgraph_10.5.6-2_amd64.deb mariadb-plugin-oqgraph amd64 1:10.5.6-2 [97.6 kB] Get:22 /build/mariadb-plugin-rocksdb_10.5.6-2_amd64.deb mariadb-plugin-rocksdb amd64 1:10.5.6-2 [2469 kB] Get:23 /build/mariadb-plugin-s3_10.5.6-2_amd64.deb mariadb-plugin-s3 amd64 1:10.5.6-2 [792 kB] Get:24 /build/mariadb-plugin-spider_10.5.6-2_amd64.deb mariadb-plugin-spider amd64 1:10.5.6-2 [387 kB] Get:25 /build/mariadb-server_10.5.6-2_all.deb mariadb-server all 1:10.5.6-2 [33.6 kB] Get:26 /build/mariadb-test-data_10.5.6-2_all.deb mariadb-test-data all 1:10.5.6-2 [25.0 MB] Get:27 /build/mariadb-test_10.5.6-2_amd64.deb mariadb-test amd64 1:10.5.6-2 [11.6 MB] Get:28 http://deb.debian.org/debian sid/main amd64 libc6 amd64 2.31-9 [2812 kB] Get:29 http://deb.debian.org/debian sid/main amd64 libgdbm6 amd64 1.19-2 [64.9 kB] Get:30 http://deb.debian.org/debian sid/main amd64 libgdbm-compat4 amd64 1.19-2 [44.7 kB] Get:31 http://deb.debian.org/debian sid/main amd64 libperl5.32 amd64 5.32.1-2 [4101 kB] Get:32 http://deb.debian.org/debian sid/main amd64 perl amd64 5.32.1-2 [293 kB] Get:33 http://deb.debian.org/debian sid/main amd64 libmpfr6 amd64 4.1.0-3 [2012 kB] Get:34 http://deb.debian.org/debian sid/main amd64 readline-common all 8.1-1 [73.7 kB] Get:35 http://deb.debian.org/debian sid/main amd64 libtinfo6 amd64 6.2+20201114-2 [341 kB] Get:36 http://deb.debian.org/debian sid/main amd64 libreadline8 amd64 8.1-1 [169 kB] Get:37 http://deb.debian.org/debian sid/main amd64 libsigsegv2 amd64 2.13-1 [34.8 kB] Get:38 http://deb.debian.org/debian sid/main amd64 gawk amd64 1:5.0.1+dfsg-1 [610 kB] Get:39 http://deb.debian.org/debian sid/main amd64 mysql-common all 5.8+1.0.7 [7464 B] Get:40 http://deb.debian.org/debian sid/main amd64 libssl1.1 amd64 1.1.1i-3 [1553 kB] Get:41 http://deb.debian.org/debian sid/main amd64 galera-4 amd64 26.4.7-2 [848 kB] Get:42 http://deb.debian.org/debian sid/main amd64 libdbi-perl amd64 1.643-3+b1 [780 kB] Get:43 http://deb.debian.org/debian sid/main amd64 lsof amd64 4.93.2+dfsg-1.1 [319 kB] Get:44 http://deb.debian.org/debian sid/main amd64 libconfig-inifiles-perl all 3.000003-1 [52.1 kB] Get:45 http://deb.debian.org/debian sid/main amd64 libncurses6 amd64 6.2+20201114-2 [102 kB] Get:46 http://deb.debian.org/debian sid/main amd64 libaio1 amd64 0.3.112-9 [12.5 kB] Get:47 http://deb.debian.org/debian sid/main amd64 libsnappy1v5 amd64 1.1.8-1 [17.9 kB] Get:48 http://deb.debian.org/debian sid/main amd64 libncursesw6 amd64 6.2+20201114-2 [132 kB] Get:49 http://deb.debian.org/debian sid/main amd64 libprocps8 amd64 2:3.3.17-1 [63.5 kB] Get:50 http://deb.debian.org/debian sid/main amd64 procps amd64 2:3.3.17-1 [268 kB] Get:51 http://deb.debian.org/debian sid/main amd64 psmisc amd64 23.4-2 [198 kB] Get:52 http://deb.debian.org/debian sid/main amd64 libpopt0 amd64 1.18-2 [49.6 kB] Get:53 http://deb.debian.org/debian sid/main amd64 libxxhash0 amd64 0.8.0-2 [26.9 kB] Get:54 http://deb.debian.org/debian sid/main amd64 rsync amd64 3.2.3-4 [333 kB] Get:55 http://deb.debian.org/debian sid/main amd64 libkrb5support0 amd64 1.18.3-4 [65.1 kB] Get:56 http://deb.debian.org/debian sid/main amd64 libk5crypto3 amd64 1.18.3-4 [113 kB] Get:57 http://deb.debian.org/debian sid/main amd64 libkeyutils1 amd64 1.6.1-2 [15.4 kB] Get:58 http://deb.debian.org/debian sid/main amd64 libkrb5-3 amd64 1.18.3-4 [362 kB] Get:59 http://deb.debian.org/debian sid/main amd64 libgssapi-krb5-2 amd64 1.18.3-4 [165 kB] Get:60 http://deb.debian.org/debian sid/main amd64 libtirpc-common all 1.3.1-1 [13.4 kB] Get:61 http://deb.debian.org/debian sid/main amd64 libtirpc3 amd64 1.3.1-1 [83.6 kB] Get:62 http://deb.debian.org/debian sid/main amd64 libnsl2 amd64 1.3.0-2 [39.5 kB] Get:63 http://deb.debian.org/debian sid/main amd64 libwrap0 amd64 7.6.q-31 [59.0 kB] Get:64 http://deb.debian.org/debian sid/main amd64 socat amd64 1.7.4.1-3 [370 kB] Get:65 http://deb.debian.org/debian sid/main amd64 libpython3.9-minimal amd64 3.9.1-4 [800 kB] Get:66 http://deb.debian.org/debian sid/main amd64 libexpat1 amd64 2.2.10-1 [96.9 kB] Get:67 http://deb.debian.org/debian sid/main amd64 python3.9-minimal amd64 3.9.1-4 [1956 kB] Get:68 http://deb.debian.org/debian sid/main amd64 python3-minimal amd64 3.9.1-1 [37.8 kB] Get:69 http://deb.debian.org/debian sid/main amd64 media-types all 4.0.0 [30.3 kB] Get:70 http://deb.debian.org/debian sid/main amd64 libmpdec3 amd64 2.5.1-1 [87.7 kB] Get:71 http://deb.debian.org/debian sid/main amd64 libsqlite3-0 amd64 3.34.1-1 [797 kB] Get:72 http://deb.debian.org/debian sid/main amd64 libpython3.9-stdlib amd64 3.9.1-4 [1683 kB] Get:73 http://deb.debian.org/debian sid/main amd64 python3.9 amd64 3.9.1-4 [465 kB] Get:74 http://deb.debian.org/debian sid/main amd64 libpython3-stdlib amd64 3.9.1-1 [21.0 kB] Get:75 http://deb.debian.org/debian sid/main amd64 python3 amd64 3.9.1-1 [64.1 kB] Get:76 http://deb.debian.org/debian sid/main amd64 libnettle8 amd64 3.7-2 [267 kB] Get:77 http://deb.debian.org/debian sid/main amd64 libhogweed6 amd64 3.7-2 [319 kB] Get:78 http://deb.debian.org/debian sid/main amd64 libidn2-0 amd64 2.3.0-5 [86.1 kB] Get:79 http://deb.debian.org/debian sid/main amd64 libp11-kit0 amd64 0.23.22-1 [337 kB] Get:80 http://deb.debian.org/debian sid/main amd64 libgnutls30 amd64 3.7.0-6 [1329 kB] Get:81 http://deb.debian.org/debian sid/main amd64 netbase all 6.2 [19.9 kB] Get:82 http://deb.debian.org/debian sid/main amd64 sensible-utils all 0.0.14 [14.8 kB] Get:83 http://deb.debian.org/debian sid/main amd64 openssl amd64 1.1.1i-3 [849 kB] Get:84 http://deb.debian.org/debian sid/main amd64 ca-certificates all 20210119 [158 kB] Get:85 http://deb.debian.org/debian sid/main amd64 libmagic-mgc amd64 1:5.39-3 [273 kB] Get:86 http://deb.debian.org/debian sid/main amd64 libmagic1 amd64 1:5.39-3 [126 kB] Get:87 http://deb.debian.org/debian sid/main amd64 file amd64 1:5.39-3 [69.1 kB] Get:88 http://deb.debian.org/debian sid/main amd64 krb5-locales all 1.18.3-4 [95.2 kB] Get:89 http://deb.debian.org/debian sid/main amd64 manpages all 5.10-1 [1412 kB] Get:90 http://deb.debian.org/debian sid/main amd64 ucf all 3.0043 [74.0 kB] Get:91 http://deb.debian.org/debian sid/main amd64 wamerican all 2019.10.06-1 [215 kB] Get:92 http://deb.debian.org/debian sid/main amd64 libcrack2 amd64 2.9.6-3.4 [56.0 kB] Get:93 http://deb.debian.org/debian sid/main amd64 cracklib-runtime amd64 2.9.6-3.4 [155 kB] Get:94 http://deb.debian.org/debian sid/main amd64 fonts-dejavu-core all 2.37-2 [1069 kB] Get:95 http://deb.debian.org/debian sid/main amd64 fontconfig-config all 2.13.1-4.2 [281 kB] Get:96 http://deb.debian.org/debian sid/main amd64 libbrotli1 amd64 1.0.9-2+b2 [279 kB] Get:97 http://deb.debian.org/debian sid/main amd64 libc-dev-bin amd64 2.31-9 [274 kB] Get:98 http://deb.debian.org/debian sid/main amd64 libpng16-16 amd64 1.6.37-3 [294 kB] Get:99 http://deb.debian.org/debian sid/main amd64 libfreetype6 amd64 2.10.4+dfsg-1 [418 kB] Get:100 http://deb.debian.org/debian sid/main amd64 libfontconfig1 amd64 2.13.1-4.2 [347 kB] Get:101 http://deb.debian.org/debian sid/main amd64 libjpeg62-turbo amd64 1:2.0.5-2 [149 kB] Get:102 http://deb.debian.org/debian sid/main amd64 libdeflate0 amd64 1.7-1 [53.1 kB] Get:103 http://deb.debian.org/debian sid/main amd64 libjbig0 amd64 2.1-3.1+b2 [31.0 kB] Get:104 http://deb.debian.org/debian sid/main amd64 libwebp6 amd64 0.6.1-2+b1 [261 kB] Get:105 http://deb.debian.org/debian sid/main amd64 libtiff5 amd64 4.2.0-1 [289 kB] Get:106 http://deb.debian.org/debian sid/main amd64 libxau6 amd64 1:1.0.9-1 [19.7 kB] Get:107 http://deb.debian.org/debian sid/main amd64 libxdmcp6 amd64 1:1.1.2-3 [26.3 kB] Get:108 http://deb.debian.org/debian sid/main amd64 libxcb1 amd64 1.14-3 [140 kB] Get:109 http://deb.debian.org/debian sid/main amd64 libx11-data all 2:1.7.0-2 [310 kB] Get:110 http://deb.debian.org/debian sid/main amd64 libx11-6 amd64 2:1.7.0-2 [771 kB] Get:111 http://deb.debian.org/debian sid/main amd64 libxpm4 amd64 1:3.5.12-1 [49.1 kB] Get:112 http://deb.debian.org/debian sid/main amd64 libgd3 amd64 2.3.0-2 [137 kB] Get:113 http://deb.debian.org/debian sid/main amd64 libc-devtools amd64 2.31-9 [244 kB] Get:114 http://deb.debian.org/debian sid/main amd64 linux-libc-dev amd64 5.10.13-1 [1283 kB] Get:115 http://deb.debian.org/debian sid/main amd64 libcrypt-dev amd64 1:4.4.17-1 [104 kB] Get:116 http://deb.debian.org/debian sid/main amd64 libtirpc-dev amd64 1.3.1-1 [190 kB] Get:117 http://deb.debian.org/debian sid/main amd64 libnsl-dev amd64 1.3.0-2 [66.4 kB] Get:118 http://deb.debian.org/debian sid/main amd64 libc6-dev amd64 2.31-9 [2346 kB] Get:119 http://deb.debian.org/debian sid/main amd64 libhtml-tagset-perl all 3.20-4 [13.0 kB] Get:120 http://deb.debian.org/debian sid/main amd64 liburi-perl all 5.07-1 [90.4 kB] Get:121 http://deb.debian.org/debian sid/main amd64 libhtml-parser-perl amd64 3.75-1+b1 [105 kB] Get:122 http://deb.debian.org/debian sid/main amd64 libcgi-pm-perl all 4.51-1 [224 kB] Get:123 http://deb.debian.org/debian sid/main amd64 libfcgi0ldbl amd64 2.4.2-2 [26.1 kB] Get:124 http://deb.debian.org/debian sid/main amd64 libfcgi-perl amd64 0.79+ds-2 [27.6 kB] Get:125 http://deb.debian.org/debian sid/main amd64 libcgi-fast-perl all 1:2.15-1 [12.1 kB] Get:126 http://deb.debian.org/debian sid/main amd64 libclone-perl amd64 0.45-1+b1 [15.4 kB] Get:127 http://deb.debian.org/debian sid/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg-2 [69.0 kB] Get:128 http://deb.debian.org/debian sid/main amd64 libsasl2-2 amd64 2.1.27+dfsg-2 [106 kB] Get:129 http://deb.debian.org/debian sid/main amd64 libldap-2.4-2 amd64 2.4.57+dfsg-1 [232 kB] Get:130 http://deb.debian.org/debian sid/main amd64 libnghttp2-14 amd64 1.42.0-1 [78.5 kB] Get:131 http://deb.debian.org/debian sid/main amd64 libpsl5 amd64 0.21.0-1.2 [57.3 kB] Get:132 http://deb.debian.org/debian sid/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2+b2 [60.8 kB] Get:133 http://deb.debian.org/debian sid/main amd64 libssh2-1 amd64 1.9.0-2 [156 kB] Get:134 http://deb.debian.org/debian sid/main amd64 libcurl4 amd64 7.74.0-1 [341 kB] Get:135 http://deb.debian.org/debian sid/main amd64 libdbd-mariadb-perl amd64 1.21-3 [110 kB] Get:136 http://deb.debian.org/debian sid/main amd64 libencode-locale-perl all 1.05-1.1 [13.2 kB] Get:137 http://deb.debian.org/debian sid/main amd64 libevent-2.1-7 amd64 2.1.12-stable-1 [188 kB] Get:138 http://deb.debian.org/debian sid/main amd64 libfcgi-bin amd64 2.4.2-2 [12.9 kB] Get:139 http://deb.debian.org/debian sid/main amd64 libgflags2.2 amd64 2.2.2-2 [83.5 kB] Get:140 http://deb.debian.org/debian sid/main amd64 libgmpxx4ldbl amd64 2:6.2.1+dfsg-1 [337 kB] Get:141 http://deb.debian.org/debian sid/main amd64 libgmp-dev amd64 2:6.2.1+dfsg-1 [643 kB] Get:142 http://deb.debian.org/debian sid/main amd64 libunbound8 amd64 1.13.1-1 [504 kB] Get:143 http://deb.debian.org/debian sid/main amd64 libgnutls-dane0 amd64 3.7.0-6 [386 kB] Get:144 http://deb.debian.org/debian sid/main amd64 libgnutls-openssl27 amd64 3.7.0-6 [386 kB] Get:145 http://deb.debian.org/debian sid/main amd64 libgnutlsxx28 amd64 3.7.0-6 [14.5 kB] Get:146 http://deb.debian.org/debian sid/main amd64 libidn2-dev amd64 2.3.0-5 [87.7 kB] Get:147 http://deb.debian.org/debian sid/main amd64 libp11-kit-dev amd64 0.23.22-1 [214 kB] Get:148 http://deb.debian.org/debian sid/main amd64 libtasn1-6-dev amd64 4.16.0-2 [104 kB] Get:149 http://deb.debian.org/debian sid/main amd64 nettle-dev amd64 3.7-2 [1259 kB] Get:150 http://deb.debian.org/debian sid/main amd64 libgnutls28-dev amd64 3.7.0-6 [1293 kB] Get:151 http://deb.debian.org/debian sid/main amd64 libgpm2 amd64 1.20.7-8 [35.6 kB] Get:152 http://deb.debian.org/debian sid/main amd64 libhtml-template-perl all 2.97-1.1 [66.2 kB] Get:153 http://deb.debian.org/debian sid/main amd64 libtimedate-perl all 2.3300-1 [39.2 kB] Get:154 http://deb.debian.org/debian sid/main amd64 libhttp-date-perl all 6.05-1 [10.4 kB] Get:155 http://deb.debian.org/debian sid/main amd64 libio-html-perl all 1.004-1 [15.9 kB] Get:156 http://deb.debian.org/debian sid/main amd64 liblwp-mediatypes-perl all 6.04-1 [19.9 kB] Get:157 http://deb.debian.org/debian sid/main amd64 libhttp-message-perl all 6.27-1 [79.5 kB] Get:158 http://deb.debian.org/debian sid/main amd64 libicu67 amd64 67.1-6 [8625 kB] Get:159 http://deb.debian.org/debian sid/main amd64 libjudydebian1 amd64 1.0.5-5+b2 [102 kB] Get:160 http://deb.debian.org/debian sid/main amd64 libldap-common all 2.4.57+dfsg-1 [95.5 kB] Get:161 http://deb.debian.org/debian sid/main amd64 libltdl7 amd64 2.4.6-15 [391 kB] Get:162 http://deb.debian.org/debian sid/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2 [190 kB] Get:163 http://deb.debian.org/debian sid/main amd64 libodbc1 amd64 2.3.6-0.1+b1 [224 kB] Get:164 http://deb.debian.org/debian sid/main amd64 libpcre2-posix2 amd64 10.36-2 [49.1 kB] Get:165 http://deb.debian.org/debian sid/main amd64 libsasl2-modules amd64 2.1.27+dfsg-2 [104 kB] Get:166 http://deb.debian.org/debian sid/main amd64 libtasn1-doc all 4.16.0-2 [321 kB] Get:167 http://deb.debian.org/debian sid/main amd64 libterm-readkey-perl amd64 2.38-1+b2 [27.8 kB] Get:168 http://deb.debian.org/debian sid/main amd64 libxml2 amd64 2.9.10+dfsg-6.3+b1 [693 kB] Get:169 http://deb.debian.org/debian sid/main amd64 manpages-dev all 5.10-1 [2309 kB] Get:170 http://deb.debian.org/debian sid/main amd64 odbcinst amd64 2.3.6-0.1+b1 [48.7 kB] Get:171 http://deb.debian.org/debian sid/main amd64 odbcinst1debian2 amd64 2.3.6-0.1+b1 [78.6 kB] Get:172 http://deb.debian.org/debian sid/main amd64 unixodbc amd64 2.3.6-0.1+b1 [61.4 kB] Get:173 http://deb.debian.org/debian sid/main amd64 rocksdb-tools amd64 6.11.4-3 [5343 kB] Get:174 http://deb.debian.org/debian sid/main amd64 publicsuffix all 20210108.1309-1 [121 kB] Get:175 http://deb.debian.org/debian sid/main amd64 python3-mysqldb amd64 1.4.4-2+b3 [57.0 kB] Fetched 68.7 MB in 11s (6079 kB/s) debconf: delaying package configuration, since apt-utils is not installed (Reading database ... 6842 files and directories currently installed.) Preparing to unpack .../perl-base_5.32.1-2_amd64.deb ... Unpacking perl-base (5.32.1-2) over (5.32.0-5) ... Setting up perl-base (5.32.1-2) ... Selecting previously unselected package perl-modules-5.32. (Reading database ... 6842 files and directories currently installed.) Preparing to unpack .../perl-modules-5.32_5.32.1-2_all.deb ... Unpacking perl-modules-5.32 (5.32.1-2) ... Preparing to unpack .../libc6_2.31-9_amd64.deb ... Unpacking libc6:amd64 (2.31-9) over (2.31-5) ... Setting up libc6:amd64 (2.31-9) ... Selecting previously unselected package libgdbm6:amd64. (Reading database ... 8236 files and directories currently installed.) Preparing to unpack .../0-libgdbm6_1.19-2_amd64.deb ... Unpacking libgdbm6:amd64 (1.19-2) ... Selecting previously unselected package libgdbm-compat4:amd64. Preparing to unpack .../1-libgdbm-compat4_1.19-2_amd64.deb ... Unpacking libgdbm-compat4:amd64 (1.19-2) ... Selecting previously unselected package libperl5.32:amd64. Preparing to unpack .../2-libperl5.32_5.32.1-2_amd64.deb ... Unpacking libperl5.32:amd64 (5.32.1-2) ... Selecting previously unselected package perl. Preparing to unpack .../3-perl_5.32.1-2_amd64.deb ... Unpacking perl (5.32.1-2) ... Selecting previously unselected package libmpfr6:amd64. Preparing to unpack .../4-libmpfr6_4.1.0-3_amd64.deb ... Unpacking libmpfr6:amd64 (4.1.0-3) ... Selecting previously unselected package readline-common. Preparing to unpack .../5-readline-common_8.1-1_all.deb ... Unpacking readline-common (8.1-1) ... Preparing to unpack .../6-libtinfo6_6.2+20201114-2_amd64.deb ... Unpacking libtinfo6:amd64 (6.2+20201114-2) over (6.2+20201114-1) ... Setting up libtinfo6:amd64 (6.2+20201114-2) ... Selecting previously unselected package libreadline8:amd64. (Reading database ... 8835 files and directories currently installed.) Preparing to unpack .../libreadline8_8.1-1_amd64.deb ... Unpacking libreadline8:amd64 (8.1-1) ... Selecting previously unselected package libsigsegv2:amd64. Preparing to unpack .../libsigsegv2_2.13-1_amd64.deb ... Unpacking libsigsegv2:amd64 (2.13-1) ... Setting up libmpfr6:amd64 (4.1.0-3) ... Setting up readline-common (8.1-1) ... Setting up libreadline8:amd64 (8.1-1) ... Setting up libsigsegv2:amd64 (2.13-1) ... Selecting previously unselected package gawk. (Reading database ... 8857 files and directories currently installed.) Preparing to unpack .../00-gawk_1%3a5.0.1+dfsg-1_amd64.deb ... Unpacking gawk (1:5.0.1+dfsg-1) ... Selecting previously unselected package mysql-common. Preparing to unpack .../01-mysql-common_5.8+1.0.7_all.deb ... Unpacking mysql-common (5.8+1.0.7) ... Selecting previously unselected package mariadb-common. Preparing to unpack .../02-mariadb-common_10.5.6-2_all.deb ... Unpacking mariadb-common (1:10.5.6-2) ... Selecting previously unselected package libssl1.1:amd64. Preparing to unpack .../03-libssl1.1_1.1.1i-3_amd64.deb ... Unpacking libssl1.1:amd64 (1.1.1i-3) ... Selecting previously unselected package galera-4. Preparing to unpack .../04-galera-4_26.4.7-2_amd64.deb ... Unpacking galera-4 (26.4.7-2) ... Selecting previously unselected package libdbi-perl:amd64. Preparing to unpack .../05-libdbi-perl_1.643-3+b1_amd64.deb ... Unpacking libdbi-perl:amd64 (1.643-3+b1) ... Selecting previously unselected package lsof. Preparing to unpack .../06-lsof_4.93.2+dfsg-1.1_amd64.deb ... Unpacking lsof (4.93.2+dfsg-1.1) ... Selecting previously unselected package libconfig-inifiles-perl. Preparing to unpack .../07-libconfig-inifiles-perl_3.000003-1_all.deb ... Unpacking libconfig-inifiles-perl (3.000003-1) ... Selecting previously unselected package libmariadb3:amd64. Preparing to unpack .../08-libmariadb3_10.5.6-2_amd64.deb ... Unpacking libmariadb3:amd64 (1:10.5.6-2) ... Selecting previously unselected package libncurses6:amd64. Preparing to unpack .../09-libncurses6_6.2+20201114-2_amd64.deb ... Unpacking libncurses6:amd64 (6.2+20201114-2) ... Selecting previously unselected package libreadline5:amd64. Preparing to unpack .../10-libreadline5_5.2+dfsg-3+b13_amd64.deb ... Unpacking libreadline5:amd64 (5.2+dfsg-3+b13) ... Selecting previously unselected package mariadb-client-core-10.5. Preparing to unpack .../11-mariadb-client-core-10.5_10.5.6-2_amd64.deb ... Unpacking mariadb-client-core-10.5 (1:10.5.6-2) ... Selecting previously unselected package mariadb-client-10.5. Preparing to unpack .../12-mariadb-client-10.5_10.5.6-2_amd64.deb ... Unpacking mariadb-client-10.5 (1:10.5.6-2) ... Selecting previously unselected package libaio1:amd64. Preparing to unpack .../13-libaio1_0.3.112-9_amd64.deb ... Unpacking libaio1:amd64 (0.3.112-9) ... Selecting previously unselected package libsnappy1v5:amd64. Preparing to unpack .../14-libsnappy1v5_1.1.8-1_amd64.deb ... Unpacking libsnappy1v5:amd64 (1.1.8-1) ... Selecting previously unselected package mariadb-server-core-10.5. Preparing to unpack .../15-mariadb-server-core-10.5_10.5.6-2_amd64.deb ... Unpacking mariadb-server-core-10.5 (1:10.5.6-2) ... Selecting previously unselected package libncursesw6:amd64. Preparing to unpack .../16-libncursesw6_6.2+20201114-2_amd64.deb ... Unpacking libncursesw6:amd64 (6.2+20201114-2) ... Selecting previously unselected package libprocps8:amd64. Preparing to unpack .../17-libprocps8_2%3a3.3.17-1_amd64.deb ... Unpacking libprocps8:amd64 (2:3.3.17-1) ... Selecting previously unselected package procps. Preparing to unpack .../18-procps_2%3a3.3.17-1_amd64.deb ... Unpacking procps (2:3.3.17-1) ... Selecting previously unselected package psmisc. Preparing to unpack .../19-psmisc_23.4-2_amd64.deb ... Unpacking psmisc (23.4-2) ... Selecting previously unselected package libpopt0:amd64. Preparing to unpack .../20-libpopt0_1.18-2_amd64.deb ... Unpacking libpopt0:amd64 (1.18-2) ... Selecting previously unselected package libxxhash0:amd64. Preparing to unpack .../21-libxxhash0_0.8.0-2_amd64.deb ... Unpacking libxxhash0:amd64 (0.8.0-2) ... Selecting previously unselected package rsync. Preparing to unpack .../22-rsync_3.2.3-4_amd64.deb ... Unpacking rsync (3.2.3-4) ... Selecting previously unselected package libkrb5support0:amd64. Preparing to unpack .../23-libkrb5support0_1.18.3-4_amd64.deb ... Unpacking libkrb5support0:amd64 (1.18.3-4) ... Selecting previously unselected package libk5crypto3:amd64. Preparing to unpack .../24-libk5crypto3_1.18.3-4_amd64.deb ... Unpacking libk5crypto3:amd64 (1.18.3-4) ... Selecting previously unselected package libkeyutils1:amd64. Preparing to unpack .../25-libkeyutils1_1.6.1-2_amd64.deb ... Unpacking libkeyutils1:amd64 (1.6.1-2) ... Selecting previously unselected package libkrb5-3:amd64. Preparing to unpack .../26-libkrb5-3_1.18.3-4_amd64.deb ... Unpacking libkrb5-3:amd64 (1.18.3-4) ... Selecting previously unselected package libgssapi-krb5-2:amd64. Preparing to unpack .../27-libgssapi-krb5-2_1.18.3-4_amd64.deb ... Unpacking libgssapi-krb5-2:amd64 (1.18.3-4) ... Selecting previously unselected package libtirpc-common. Preparing to unpack .../28-libtirpc-common_1.3.1-1_all.deb ... Unpacking libtirpc-common (1.3.1-1) ... Selecting previously unselected package libtirpc3:amd64. Preparing to unpack .../29-libtirpc3_1.3.1-1_amd64.deb ... Unpacking libtirpc3:amd64 (1.3.1-1) ... Selecting previously unselected package libnsl2:amd64. Preparing to unpack .../30-libnsl2_1.3.0-2_amd64.deb ... Unpacking libnsl2:amd64 (1.3.0-2) ... Selecting previously unselected package libwrap0:amd64. Preparing to unpack .../31-libwrap0_7.6.q-31_amd64.deb ... Unpacking libwrap0:amd64 (7.6.q-31) ... Selecting previously unselected package socat. Preparing to unpack .../32-socat_1.7.4.1-3_amd64.deb ... Unpacking socat (1.7.4.1-3) ... Setting up mysql-common (5.8+1.0.7) ... update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode Setting up mariadb-common (1:10.5.6-2) ... update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Selecting previously unselected package mariadb-server-10.5. (Reading database ... 9847 files and directories currently installed.) Preparing to unpack .../mariadb-server-10.5_10.5.6-2_amd64.deb ... + DEBIAN_SCRIPT_TRACE=1 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + echo '#42#DEBUG# RUNNING /var/lib/dpkg/tmp.ci/config configure ' '1>&2' #42#DEBUG# RUNNING /var/lib/dpkg/tmp.ci/config configure 1>&2 # Beware that there are two ypwhich one of them needs the 2>/dev/null! if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then db_input high mariadb-server-10.5/nis_warning || true db_go fi ++ which ypwhich + test -n '' + DEBIAN_SCRIPT_TRACE=1 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + echo '#42#DEBUG# RUNNING /var/lib/dpkg/tmp.ci/preinst install' '1>&2' #42#DEBUG# RUNNING /var/lib/dpkg/tmp.ci/preinst install 1>&2 export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin + export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin mysql_datadir=/var/lib/mysql + mysql_datadir=/var/lib/mysql mysql_upgradedir=/var/lib/mysql-upgrade + mysql_upgradedir=/var/lib/mysql-upgrade # Try to stop the server in a sane way. If it does not success let the admin # do it himself. No database directories should be removed while the server # is running! Another mariadbd in e.g. a different chroot is fine for us. stop_server() { # Return immediately if there are no mysql processes running # as there is no point in trying to shutdown in that case. if ! pgrep -x --ns $$ mariadbd > /dev/null; then return; fi # Compatibility with versions that ran 'mysqld' if ! pgrep -x --ns $$ mysqld > /dev/null; then return; fi set +e invoke-rc.d mariadb stop invoke-rc.d mysql stop # Backwards compatibility errno=$? set -e # systemctl could emit exit code 100=no init script (fresh install) if [ "$errno" != 0 -a "$errno" != 100 ]; then echo "Attempt to stop MariaDB/MySQL server returned exitcode $errno" 1>&2 echo "There is a MariaDB/MySQL server running, but we failed in our attempts to stop it." 1>&2 echo "Stop it yourself and try again!" 1>&2 db_stop exit 1 fi } ################################ main() ########################## this_version=$MAJOR_VER + this_version=10.5 max_upgradeable_version=5.7 + max_upgradeable_version=5.7 # Check if a flag file is found that indicates a previous MariaDB or MySQL # version was installed. If multiple flags are found, check which one was # the biggest version number. for flag in $mysql_datadir/debian-*.flag do # The for loop leaves $flag as the query string if there are no results, # so the check below is needed to stop further processing when there are # no real results. if [ "$flag" = "$mysql_datadir/debian-*.flag" ] then break fi flag_version=$(echo "$flag" | sed 's/.*debian-\([0-9\.]\+\).flag/\1/') # Initialize value if empty if [ -z "$found_version" ] then found_version=$flag_version fi # Update value if now bigger then before if dpkg --compare-versions "$flag_version" '>>' "$found_version" then found_version=$flag_version fi done + for flag in $mysql_datadir/debian-*.flag + '[' '/var/lib/mysql/debian-*.flag' = '/var/lib/mysql/debian-*.flag' ']' + break # If an upgrade is detected, proceed with it automatically without # requiring any user interaction. # # However, if the user attempts to downgrade, warn about the incompatibility. # Downgrade is detected if the flag version is bigger than $this_version # (e.g. 10.1 > 10.0) or the flag version is smaller than 10.0 but bigger # than $max_upgradeable_version. if [ ! -z "$found_version" ] then # MySQL 8.0 in Ubuntu has a bug in packaging and the file is name wrongly # 'debian-5.7.flag', so in case '5.7' was encountered an extra check needs to # be done to see is there is a file called undo_001, which is a sign of 8.0. if [ "$found_version" == "5.7" ] && [ -f "$mysql_datadir/undo_001" ] then # Seems to be a 8.0, flag has wrongly 5.7 (know bug) found_version=8.0 fi echo "$mysql_datadir: found previous version $found_version" if dpkg --compare-versions "$found_version" '>>' "$this_version" then downgrade_detected=true fi if dpkg --compare-versions "$found_version" '>>' "$max_upgradeable_version" \ && dpkg --compare-versions "$found_version" '<<' "10.0" then downgrade_detected=true fi fi + '[' '!' -z '' ']' # Don't abort dpkg if downgrade is detected (as was done previously). # Instead simply move the old datadir and create a new for this_version. if [ ! -z "$downgrade_detected" ] then db_input critical "mariadb-server-$MAJOR_VER/old_data_directory_saved" || true db_go echo "The file $mysql_datadir/debian-$found_version.flag indicates a" 1>&2 echo "version that cannot automatically be upgraded. Therefore the" 1>&2 echo "previous data directory will be renamed to $mysql_datadir-$found_version and" 1>&2 echo "a new data directory will be initialized at $mysql_datadir." 1>&2 echo "Please manually export/import your data (e.g. with mysqldump) if needed." 1>&2 mv -f "$mysql_datadir" "$mysql_datadir-$found_version" # Also move away the old debian.cnf file that included credentials that are # no longer valid mv -f /etc/mysql/debian.cnf "/etc/mysql/debian.cnf-$found_version" fi + '[' '!' -z '' ']' # to be sure stop_server + stop_server + pgrep -x --ns 639 mariadbd + return # If we use NIS then errors should be tolerated. It's up to the # user to ensure that the mysql user is correctly setup. # Beware that there are two ypwhich one of them needs the 2>/dev/null! if test -n "$(which ypwhich 2>/dev/null)" && ypwhich >/dev/null 2>&1; then set +e fi ++ which ypwhich + test -n '' # # Now we have to ensure the following state: # /etc/passwd: mysql:x:100:101:MySQL Server:/nonexistent:/bin/false # /etc/group: mysql:x:101: # # Sadly there could any state be present on the system so we have to # modify everything carefully i.e. not doing a chown before creating # the user etc... # # creating mysql group if he isn't already there if ! getent group mysql >/dev/null; then # Adding system group: mysql. addgroup --system mysql >/dev/null fi + getent group mysql + addgroup --system mysql # creating mysql user if he isn't already there if ! getent passwd mysql >/dev/null; then # Adding system user: mysql. adduser \ --system \ --disabled-login \ --ingroup mysql \ --no-create-home \ --home /nonexistent \ --gecos "MySQL Server" \ --shell /bin/false \ mysql >/dev/null fi + getent passwd mysql + adduser --system --disabled-login --ingroup mysql --no-create-home --home /nonexistent --gecos 'MySQL Server' --shell /bin/false mysql # end of NIS tolerance zone set -e + set -e # if there's a symlink, let's store where it's pointing, because otherwise # it's going to be lost in some situations for dir in DATADIR LOGDIR; do checkdir=$(eval echo "$"$dir) if [ -L "$checkdir" ]; then # Use mkdir option 'Z' to create with correct SELinux context. mkdir -pZ "$mysql_upgradedir" cp -dT "$checkdir" "$mysql_upgradedir/$dir.link" fi done + for dir in DATADIR LOGDIR ++ eval echo '$DATADIR' +++ echo + checkdir= + '[' -L '' ']' + for dir in DATADIR LOGDIR ++ eval echo '$LOGDIR' +++ echo + checkdir= + '[' -L '' ']' # creating mysql home directory if [ ! -d $mysql_datadir ] && [ ! -L $mysql_datadir ]; then # Use mkdir option 'Z' to create with correct SELinux context. mkdir -Z $mysql_datadir fi + '[' '!' -d /var/lib/mysql ']' + '[' '!' -L /var/lib/mysql ']' + mkdir -Z /var/lib/mysql # checking disc space if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; then echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2 db_stop exit 1 fi + tail -n 1 + LC_ALL=C + awk '{ exit ($4>1000) }' + BLOCKSIZE= + df --portability /var/lib/mysql/. # Since the home directory was created before putting the user into # the mysql group and moreover we cannot guarantee that the # permissions were correctly *before* calling this script, we fix them now. # In case we use NIS and no mysql user is present then this script should # better fail now than later.. # The "set +e" is necessary as e.g. a ".journal" of a ext3 partition is # not chgrp'able (#318435). set +e + set +e find $mysql_datadir ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql + xargs -0 -r chown mysql ++ id -u mysql + find /var/lib/mysql '!' -uid 101 -print0 find $mysql_datadir -follow -not -group mysql -print0 2>/dev/null \ | xargs -0 --no-run-if-empty chgrp mysql + find /var/lib/mysql -follow -not -group mysql -print0 + xargs -0 --no-run-if-empty chgrp mysql set -e + set -e db_stop + db_stop + echo STOP Unpacking mariadb-server-10.5 (1:10.5.6-2) ... Selecting previously unselected package libpython3.9-minimal:amd64. Preparing to unpack .../libpython3.9-minimal_3.9.1-4_amd64.deb ... Unpacking libpython3.9-minimal:amd64 (3.9.1-4) ... Selecting previously unselected package libexpat1:amd64. Preparing to unpack .../libexpat1_2.2.10-1_amd64.deb ... Unpacking libexpat1:amd64 (2.2.10-1) ... Selecting previously unselected package python3.9-minimal. Preparing to unpack .../python3.9-minimal_3.9.1-4_amd64.deb ... Unpacking python3.9-minimal (3.9.1-4) ... Setting up libssl1.1:amd64 (1.1.1i-3) ... Setting up libpython3.9-minimal:amd64 (3.9.1-4) ... Setting up libexpat1:amd64 (2.2.10-1) ... Setting up python3.9-minimal (3.9.1-4) ... Selecting previously unselected package python3-minimal. (Reading database ... 10284 files and directories currently installed.) Preparing to unpack .../0-python3-minimal_3.9.1-1_amd64.deb ... Unpacking python3-minimal (3.9.1-1) ... Selecting previously unselected package media-types. Preparing to unpack .../1-media-types_4.0.0_all.deb ... Unpacking media-types (4.0.0) ... Selecting previously unselected package libmpdec3:amd64. Preparing to unpack .../2-libmpdec3_2.5.1-1_amd64.deb ... Unpacking libmpdec3:amd64 (2.5.1-1) ... Selecting previously unselected package libsqlite3-0:amd64. Preparing to unpack .../3-libsqlite3-0_3.34.1-1_amd64.deb ... Unpacking libsqlite3-0:amd64 (3.34.1-1) ... Selecting previously unselected package libpython3.9-stdlib:amd64. Preparing to unpack .../4-libpython3.9-stdlib_3.9.1-4_amd64.deb ... Unpacking libpython3.9-stdlib:amd64 (3.9.1-4) ... Selecting previously unselected package python3.9. Preparing to unpack .../5-python3.9_3.9.1-4_amd64.deb ... Unpacking python3.9 (3.9.1-4) ... Selecting previously unselected package libpython3-stdlib:amd64. Preparing to unpack .../6-libpython3-stdlib_3.9.1-1_amd64.deb ... Unpacking libpython3-stdlib:amd64 (3.9.1-1) ... Setting up python3-minimal (3.9.1-1) ... Selecting previously unselected package python3. (Reading database ... 10689 files and directories currently installed.) Preparing to unpack .../python3_3.9.1-1_amd64.deb ... Unpacking python3 (3.9.1-1) ... Preparing to unpack .../libnettle8_3.7-2_amd64.deb ... Unpacking libnettle8:amd64 (3.7-2) over (3.6-2) ... Setting up libnettle8:amd64 (3.7-2) ... (Reading database ... 10723 files and directories currently installed.) Preparing to unpack .../libhogweed6_3.7-2_amd64.deb ... Unpacking libhogweed6:amd64 (3.7-2) over (3.6-2) ... Setting up libhogweed6:amd64 (3.7-2) ... (Reading database ... 10723 files and directories currently installed.) Preparing to unpack .../libidn2-0_2.3.0-5_amd64.deb ... Unpacking libidn2-0:amd64 (2.3.0-5) over (2.3.0-4) ... Setting up libidn2-0:amd64 (2.3.0-5) ... (Reading database ... 10723 files and directories currently installed.) Preparing to unpack .../libp11-kit0_0.23.22-1_amd64.deb ... Unpacking libp11-kit0:amd64 (0.23.22-1) over (0.23.21-2) ... Setting up libp11-kit0:amd64 (0.23.22-1) ... (Reading database ... 10723 files and directories currently installed.) Preparing to unpack .../libgnutls30_3.7.0-6_amd64.deb ... Unpacking libgnutls30:amd64 (3.7.0-6) over (3.7.0-3) ... Setting up libgnutls30:amd64 (3.7.0-6) ... Selecting previously unselected package netbase. (Reading database ... 10723 files and directories currently installed.) Preparing to unpack .../000-netbase_6.2_all.deb ... Unpacking netbase (6.2) ... Selecting previously unselected package sensible-utils. Preparing to unpack .../001-sensible-utils_0.0.14_all.deb ... Unpacking sensible-utils (0.0.14) ... Selecting previously unselected package openssl. Preparing to unpack .../002-openssl_1.1.1i-3_amd64.deb ... Unpacking openssl (1.1.1i-3) ... Selecting previously unselected package ca-certificates. Preparing to unpack .../003-ca-certificates_20210119_all.deb ... Unpacking ca-certificates (20210119) ... Selecting previously unselected package libmagic-mgc. Preparing to unpack .../004-libmagic-mgc_1%3a5.39-3_amd64.deb ... Unpacking libmagic-mgc (1:5.39-3) ... Selecting previously unselected package libmagic1:amd64. Preparing to unpack .../005-libmagic1_1%3a5.39-3_amd64.deb ... Unpacking libmagic1:amd64 (1:5.39-3) ... Selecting previously unselected package file. Preparing to unpack .../006-file_1%3a5.39-3_amd64.deb ... Unpacking file (1:5.39-3) ... Selecting previously unselected package krb5-locales. Preparing to unpack .../007-krb5-locales_1.18.3-4_all.deb ... Unpacking krb5-locales (1.18.3-4) ... Selecting previously unselected package manpages. Preparing to unpack .../008-manpages_5.10-1_all.deb ... Unpacking manpages (5.10-1) ... Selecting previously unselected package ucf. Preparing to unpack .../009-ucf_3.0043_all.deb ... Moving old data out of the way Unpacking ucf (3.0043) ... Selecting previously unselected package wamerican. Preparing to unpack .../010-wamerican_2019.10.06-1_all.deb ... Unpacking wamerican (2019.10.06-1) ... Selecting previously unselected package libcrack2:amd64. Preparing to unpack .../011-libcrack2_2.9.6-3.4_amd64.deb ... Unpacking libcrack2:amd64 (2.9.6-3.4) ... Selecting previously unselected package cracklib-runtime. Preparing to unpack .../012-cracklib-runtime_2.9.6-3.4_amd64.deb ... Unpacking cracklib-runtime (2.9.6-3.4) ... Selecting previously unselected package fonts-dejavu-core. Preparing to unpack .../013-fonts-dejavu-core_2.37-2_all.deb ... Unpacking fonts-dejavu-core (2.37-2) ... Selecting previously unselected package fontconfig-config. Preparing to unpack .../014-fontconfig-config_2.13.1-4.2_all.deb ... Unpacking fontconfig-config (2.13.1-4.2) ... Selecting previously unselected package libbrotli1:amd64. Preparing to unpack .../015-libbrotli1_1.0.9-2+b2_amd64.deb ... Unpacking libbrotli1:amd64 (1.0.9-2+b2) ... Selecting previously unselected package libc-dev-bin. Preparing to unpack .../016-libc-dev-bin_2.31-9_amd64.deb ... Unpacking libc-dev-bin (2.31-9) ... Selecting previously unselected package libpng16-16:amd64. Preparing to unpack .../017-libpng16-16_1.6.37-3_amd64.deb ... Unpacking libpng16-16:amd64 (1.6.37-3) ... Selecting previously unselected package libfreetype6:amd64. Preparing to unpack .../018-libfreetype6_2.10.4+dfsg-1_amd64.deb ... Unpacking libfreetype6:amd64 (2.10.4+dfsg-1) ... Selecting previously unselected package libfontconfig1:amd64. Preparing to unpack .../019-libfontconfig1_2.13.1-4.2_amd64.deb ... Unpacking libfontconfig1:amd64 (2.13.1-4.2) ... Selecting previously unselected package libjpeg62-turbo:amd64. Preparing to unpack .../020-libjpeg62-turbo_1%3a2.0.5-2_amd64.deb ... Unpacking libjpeg62-turbo:amd64 (1:2.0.5-2) ... Selecting previously unselected package libdeflate0:amd64. Preparing to unpack .../021-libdeflate0_1.7-1_amd64.deb ... Unpacking libdeflate0:amd64 (1.7-1) ... Selecting previously unselected package libjbig0:amd64. Preparing to unpack .../022-libjbig0_2.1-3.1+b2_amd64.deb ... Unpacking libjbig0:amd64 (2.1-3.1+b2) ... Selecting previously unselected package libwebp6:amd64. Preparing to unpack .../023-libwebp6_0.6.1-2+b1_amd64.deb ... Unpacking libwebp6:amd64 (0.6.1-2+b1) ... Selecting previously unselected package libtiff5:amd64. Preparing to unpack .../024-libtiff5_4.2.0-1_amd64.deb ... Unpacking libtiff5:amd64 (4.2.0-1) ... Selecting previously unselected package libxau6:amd64. Preparing to unpack .../025-libxau6_1%3a1.0.9-1_amd64.deb ... Unpacking libxau6:amd64 (1:1.0.9-1) ... Selecting previously unselected package libxdmcp6:amd64. Preparing to unpack .../026-libxdmcp6_1%3a1.1.2-3_amd64.deb ... Unpacking libxdmcp6:amd64 (1:1.1.2-3) ... Selecting previously unselected package libxcb1:amd64. Preparing to unpack .../027-libxcb1_1.14-3_amd64.deb ... Unpacking libxcb1:amd64 (1.14-3) ... Selecting previously unselected package libx11-data. Preparing to unpack .../028-libx11-data_2%3a1.7.0-2_all.deb ... Unpacking libx11-data (2:1.7.0-2) ... Selecting previously unselected package libx11-6:amd64. Preparing to unpack .../029-libx11-6_2%3a1.7.0-2_amd64.deb ... Unpacking libx11-6:amd64 (2:1.7.0-2) ... Selecting previously unselected package libxpm4:amd64. Preparing to unpack .../030-libxpm4_1%3a3.5.12-1_amd64.deb ... Unpacking libxpm4:amd64 (1:3.5.12-1) ... Selecting previously unselected package libgd3:amd64. Preparing to unpack .../031-libgd3_2.3.0-2_amd64.deb ... Unpacking libgd3:amd64 (2.3.0-2) ... Selecting previously unselected package libc-devtools. Preparing to unpack .../032-libc-devtools_2.31-9_amd64.deb ... Unpacking libc-devtools (2.31-9) ... Selecting previously unselected package linux-libc-dev:amd64. Preparing to unpack .../033-linux-libc-dev_5.10.13-1_amd64.deb ... Unpacking linux-libc-dev:amd64 (5.10.13-1) ... Selecting previously unselected package libcrypt-dev:amd64. Preparing to unpack .../034-libcrypt-dev_1%3a4.4.17-1_amd64.deb ... Unpacking libcrypt-dev:amd64 (1:4.4.17-1) ... Selecting previously unselected package libtirpc-dev:amd64. Preparing to unpack .../035-libtirpc-dev_1.3.1-1_amd64.deb ... Unpacking libtirpc-dev:amd64 (1.3.1-1) ... Selecting previously unselected package libnsl-dev:amd64. Preparing to unpack .../036-libnsl-dev_1.3.0-2_amd64.deb ... Unpacking libnsl-dev:amd64 (1.3.0-2) ... Selecting previously unselected package libc6-dev:amd64. Preparing to unpack .../037-libc6-dev_2.31-9_amd64.deb ... Unpacking libc6-dev:amd64 (2.31-9) ... Selecting previously unselected package libhtml-tagset-perl. Preparing to unpack .../038-libhtml-tagset-perl_3.20-4_all.deb ... Unpacking libhtml-tagset-perl (3.20-4) ... Selecting previously unselected package liburi-perl. Preparing to unpack .../039-liburi-perl_5.07-1_all.deb ... Unpacking liburi-perl (5.07-1) ... Selecting previously unselected package libhtml-parser-perl. Preparing to unpack .../040-libhtml-parser-perl_3.75-1+b1_amd64.deb ... Unpacking libhtml-parser-perl (3.75-1+b1) ... Selecting previously unselected package libcgi-pm-perl. Preparing to unpack .../041-libcgi-pm-perl_4.51-1_all.deb ... Unpacking libcgi-pm-perl (4.51-1) ... Selecting previously unselected package libfcgi0ldbl:amd64. Preparing to unpack .../042-libfcgi0ldbl_2.4.2-2_amd64.deb ... Unpacking libfcgi0ldbl:amd64 (2.4.2-2) ... Selecting previously unselected package libfcgi-perl:amd64. Preparing to unpack .../043-libfcgi-perl_0.79+ds-2_amd64.deb ... Unpacking libfcgi-perl:amd64 (0.79+ds-2) ... Selecting previously unselected package libcgi-fast-perl. Preparing to unpack .../044-libcgi-fast-perl_1%3a2.15-1_all.deb ... Unpacking libcgi-fast-perl (1:2.15-1) ... Selecting previously unselected package libclone-perl. Preparing to unpack .../045-libclone-perl_0.45-1+b1_amd64.deb ... Unpacking libclone-perl (0.45-1+b1) ... Selecting previously unselected package libsasl2-modules-db:amd64. Preparing to unpack .../046-libsasl2-modules-db_2.1.27+dfsg-2_amd64.deb ... Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ... Selecting previously unselected package libsasl2-2:amd64. Preparing to unpack .../047-libsasl2-2_2.1.27+dfsg-2_amd64.deb ... Unpacking libsasl2-2:amd64 (2.1.27+dfsg-2) ... Selecting previously unselected package libldap-2.4-2:amd64. Preparing to unpack .../048-libldap-2.4-2_2.4.57+dfsg-1_amd64.deb ... Unpacking libldap-2.4-2:amd64 (2.4.57+dfsg-1) ... Selecting previously unselected package libnghttp2-14:amd64. Preparing to unpack .../049-libnghttp2-14_1.42.0-1_amd64.deb ... Unpacking libnghttp2-14:amd64 (1.42.0-1) ... Selecting previously unselected package libpsl5:amd64. Preparing to unpack .../050-libpsl5_0.21.0-1.2_amd64.deb ... Unpacking libpsl5:amd64 (0.21.0-1.2) ... Selecting previously unselected package librtmp1:amd64. Preparing to unpack .../051-librtmp1_2.4+20151223.gitfa8646d.1-2+b2_amd64.deb ... Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2+b2) ... Selecting previously unselected package libssh2-1:amd64. Preparing to unpack .../052-libssh2-1_1.9.0-2_amd64.deb ... Unpacking libssh2-1:amd64 (1.9.0-2) ... Selecting previously unselected package libcurl4:amd64. Preparing to unpack .../053-libcurl4_7.74.0-1_amd64.deb ... Unpacking libcurl4:amd64 (7.74.0-1) ... Selecting previously unselected package libdbd-mariadb-perl. Preparing to unpack .../054-libdbd-mariadb-perl_1.21-3_amd64.deb ... Unpacking libdbd-mariadb-perl (1.21-3) ... Selecting previously unselected package libencode-locale-perl. Preparing to unpack .../055-libencode-locale-perl_1.05-1.1_all.deb ... Unpacking libencode-locale-perl (1.05-1.1) ... Selecting previously unselected package libevent-2.1-7:amd64. Preparing to unpack .../056-libevent-2.1-7_2.1.12-stable-1_amd64.deb ... Unpacking libevent-2.1-7:amd64 (2.1.12-stable-1) ... Selecting previously unselected package libfcgi-bin. Preparing to unpack .../057-libfcgi-bin_2.4.2-2_amd64.deb ... Unpacking libfcgi-bin (2.4.2-2) ... Selecting previously unselected package libgflags2.2. Preparing to unpack .../058-libgflags2.2_2.2.2-2_amd64.deb ... Unpacking libgflags2.2 (2.2.2-2) ... Selecting previously unselected package libgmpxx4ldbl:amd64. Preparing to unpack .../059-libgmpxx4ldbl_2%3a6.2.1+dfsg-1_amd64.deb ... Unpacking libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-1) ... Selecting previously unselected package libgmp-dev:amd64. Preparing to unpack .../060-libgmp-dev_2%3a6.2.1+dfsg-1_amd64.deb ... Unpacking libgmp-dev:amd64 (2:6.2.1+dfsg-1) ... Selecting previously unselected package libunbound8:amd64. Preparing to unpack .../061-libunbound8_1.13.1-1_amd64.deb ... Unpacking libunbound8:amd64 (1.13.1-1) ... Selecting previously unselected package libgnutls-dane0:amd64. Preparing to unpack .../062-libgnutls-dane0_3.7.0-6_amd64.deb ... Unpacking libgnutls-dane0:amd64 (3.7.0-6) ... Selecting previously unselected package libgnutls-openssl27:amd64. Preparing to unpack .../063-libgnutls-openssl27_3.7.0-6_amd64.deb ... Unpacking libgnutls-openssl27:amd64 (3.7.0-6) ... Selecting previously unselected package libgnutlsxx28:amd64. Preparing to unpack .../064-libgnutlsxx28_3.7.0-6_amd64.deb ... Unpacking libgnutlsxx28:amd64 (3.7.0-6) ... Selecting previously unselected package libidn2-dev:amd64. Preparing to unpack .../065-libidn2-dev_2.3.0-5_amd64.deb ... Unpacking libidn2-dev:amd64 (2.3.0-5) ... Selecting previously unselected package libp11-kit-dev:amd64. Preparing to unpack .../066-libp11-kit-dev_0.23.22-1_amd64.deb ... Unpacking libp11-kit-dev:amd64 (0.23.22-1) ... Selecting previously unselected package libtasn1-6-dev:amd64. Preparing to unpack .../067-libtasn1-6-dev_4.16.0-2_amd64.deb ... Unpacking libtasn1-6-dev:amd64 (4.16.0-2) ... Selecting previously unselected package nettle-dev:amd64. Preparing to unpack .../068-nettle-dev_3.7-2_amd64.deb ... Unpacking nettle-dev:amd64 (3.7-2) ... Selecting previously unselected package libgnutls28-dev:amd64. Preparing to unpack .../069-libgnutls28-dev_3.7.0-6_amd64.deb ... Unpacking libgnutls28-dev:amd64 (3.7.0-6) ... Selecting previously unselected package libgpm2:amd64. Preparing to unpack .../070-libgpm2_1.20.7-8_amd64.deb ... Unpacking libgpm2:amd64 (1.20.7-8) ... Selecting previously unselected package libhtml-template-perl. Preparing to unpack .../071-libhtml-template-perl_2.97-1.1_all.deb ... Unpacking libhtml-template-perl (2.97-1.1) ... Selecting previously unselected package libtimedate-perl. Preparing to unpack .../072-libtimedate-perl_2.3300-1_all.deb ... Unpacking libtimedate-perl (2.3300-1) ... Selecting previously unselected package libhttp-date-perl. Preparing to unpack .../073-libhttp-date-perl_6.05-1_all.deb ... Unpacking libhttp-date-perl (6.05-1) ... Selecting previously unselected package libio-html-perl. Preparing to unpack .../074-libio-html-perl_1.004-1_all.deb ... Unpacking libio-html-perl (1.004-1) ... Selecting previously unselected package liblwp-mediatypes-perl. Preparing to unpack .../075-liblwp-mediatypes-perl_6.04-1_all.deb ... Unpacking liblwp-mediatypes-perl (6.04-1) ... Selecting previously unselected package libhttp-message-perl. Preparing to unpack .../076-libhttp-message-perl_6.27-1_all.deb ... Unpacking libhttp-message-perl (6.27-1) ... Selecting previously unselected package libicu67:amd64. Preparing to unpack .../077-libicu67_67.1-6_amd64.deb ... Unpacking libicu67:amd64 (67.1-6) ... Selecting previously unselected package libjudydebian1. Preparing to unpack .../078-libjudydebian1_1.0.5-5+b2_amd64.deb ... Unpacking libjudydebian1 (1.0.5-5+b2) ... Selecting previously unselected package libldap-common. Preparing to unpack .../079-libldap-common_2.4.57+dfsg-1_all.deb ... Unpacking libldap-common (2.4.57+dfsg-1) ... Selecting previously unselected package libltdl7:amd64. Preparing to unpack .../080-libltdl7_2.4.6-15_amd64.deb ... Unpacking libltdl7:amd64 (2.4.6-15) ... Selecting previously unselected package zlib1g-dev:amd64. Preparing to unpack .../081-zlib1g-dev_1%3a1.2.11.dfsg-2_amd64.deb ... Unpacking zlib1g-dev:amd64 (1:1.2.11.dfsg-2) ... Selecting previously unselected package libmariadb-dev. Preparing to unpack .../082-libmariadb-dev_10.5.6-2_amd64.deb ... Unpacking libmariadb-dev (1:10.5.6-2) ... Selecting previously unselected package libmariadb-dev-compat:amd64. Preparing to unpack .../083-libmariadb-dev-compat_10.5.6-2_amd64.deb ... Unpacking libmariadb-dev-compat:amd64 (1:10.5.6-2) ... Selecting previously unselected package libmariadbd19:amd64. Preparing to unpack .../084-libmariadbd19_10.5.6-2_amd64.deb ... Unpacking libmariadbd19:amd64 (1:10.5.6-2) ... Selecting previously unselected package libmariadbd-dev. Preparing to unpack .../085-libmariadbd-dev_10.5.6-2_amd64.deb ... Unpacking libmariadbd-dev (1:10.5.6-2) ... Selecting previously unselected package libodbc1:amd64. Preparing to unpack .../086-libodbc1_2.3.6-0.1+b1_amd64.deb ... Unpacking libodbc1:amd64 (2.3.6-0.1+b1) ... Selecting previously unselected package libpcre2-posix2:amd64. Preparing to unpack .../087-libpcre2-posix2_10.36-2_amd64.deb ... Unpacking libpcre2-posix2:amd64 (10.36-2) ... Selecting previously unselected package libsasl2-modules:amd64. Preparing to unpack .../088-libsasl2-modules_2.1.27+dfsg-2_amd64.deb ... Unpacking libsasl2-modules:amd64 (2.1.27+dfsg-2) ... Selecting previously unselected package libtasn1-doc. Preparing to unpack .../089-libtasn1-doc_4.16.0-2_all.deb ... Unpacking libtasn1-doc (4.16.0-2) ... Selecting previously unselected package libterm-readkey-perl. Preparing to unpack .../090-libterm-readkey-perl_2.38-1+b2_amd64.deb ... Unpacking libterm-readkey-perl (2.38-1+b2) ... Selecting previously unselected package libxml2:amd64. Preparing to unpack .../091-libxml2_2.9.10+dfsg-6.3+b1_amd64.deb ... Unpacking libxml2:amd64 (2.9.10+dfsg-6.3+b1) ... Selecting previously unselected package manpages-dev. Preparing to unpack .../092-manpages-dev_5.10-1_all.deb ... Unpacking manpages-dev (5.10-1) ... Selecting previously unselected package mariadb-backup. Preparing to unpack .../093-mariadb-backup_10.5.6-2_amd64.deb ... Unpacking mariadb-backup (1:10.5.6-2) ... Selecting previously unselected package mariadb-client. Preparing to unpack .../094-mariadb-client_10.5.6-2_all.deb ... Unpacking mariadb-client (1:10.5.6-2) ... Selecting previously unselected package odbcinst. Preparing to unpack .../095-odbcinst_2.3.6-0.1+b1_amd64.deb ... Unpacking odbcinst (2.3.6-0.1+b1) ... Selecting previously unselected package odbcinst1debian2:amd64. Preparing to unpack .../096-odbcinst1debian2_2.3.6-0.1+b1_amd64.deb ... Unpacking odbcinst1debian2:amd64 (2.3.6-0.1+b1) ... Selecting previously unselected package unixodbc. Preparing to unpack .../097-unixodbc_2.3.6-0.1+b1_amd64.deb ... Unpacking unixodbc (2.3.6-0.1+b1) ... Selecting previously unselected package mariadb-plugin-connect. Preparing to unpack .../098-mariadb-plugin-connect_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-connect (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-cracklib-password-check. Preparing to unpack .../099-mariadb-plugin-cracklib-password-check_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-cracklib-password-check (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-gssapi-client:amd64. Preparing to unpack .../100-mariadb-plugin-gssapi-client_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-gssapi-client:amd64 (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-gssapi-server. Preparing to unpack .../101-mariadb-plugin-gssapi-server_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-gssapi-server (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-mroonga. Preparing to unpack .../102-mariadb-plugin-mroonga_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-mroonga (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-oqgraph. Preparing to unpack .../103-mariadb-plugin-oqgraph_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-oqgraph (1:10.5.6-2) ... Selecting previously unselected package rocksdb-tools. Preparing to unpack .../104-rocksdb-tools_6.11.4-3_amd64.deb ... Unpacking rocksdb-tools (6.11.4-3) ... Selecting previously unselected package mariadb-plugin-rocksdb. Preparing to unpack .../105-mariadb-plugin-rocksdb_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-rocksdb (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-s3. Preparing to unpack .../106-mariadb-plugin-s3_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-s3 (1:10.5.6-2) ... Selecting previously unselected package mariadb-plugin-spider. Preparing to unpack .../107-mariadb-plugin-spider_10.5.6-2_amd64.deb ... Unpacking mariadb-plugin-spider (1:10.5.6-2) ... Selecting previously unselected package mariadb-server. Preparing to unpack .../108-mariadb-server_10.5.6-2_all.deb ... Unpacking mariadb-server (1:10.5.6-2) ... Selecting previously unselected package mariadb-test-data. Preparing to unpack .../109-mariadb-test-data_10.5.6-2_all.deb ... Unpacking mariadb-test-data (1:10.5.6-2) ... Selecting previously unselected package mariadb-test. Preparing to unpack .../110-mariadb-test_10.5.6-2_amd64.deb ... Unpacking mariadb-test (1:10.5.6-2) ... Selecting previously unselected package publicsuffix. Preparing to unpack .../111-publicsuffix_20210108.1309-1_all.deb ... Unpacking publicsuffix (20210108.1309-1) ... Selecting previously unselected package python3-mysqldb. Preparing to unpack .../112-python3-mysqldb_1.4.4-2+b3_amd64.deb ... Unpacking python3-mysqldb (1.4.4-2+b3) ... Setting up libconfig-inifiles-perl (3.000003-1) ... Setting up media-types (4.0.0) ... Setting up galera-4 (26.4.7-2) ... Setting up libxau6:amd64 (1:1.0.9-1) ... Setting up libxdmcp6:amd64 (1:1.1.2-3) ... Setting up libkeyutils1:amd64 (1.6.1-2) ... Setting up libpsl5:amd64 (0.21.0-1.2) ... Setting up libxcb1:amd64 (1.14-3) ... Setting up libgnutls-openssl27:amd64 (3.7.0-6) ... Setting up libreadline5:amd64 (5.2+dfsg-3+b13) ... Setting up libgpm2:amd64 (1.20.7-8) ... Setting up libicu67:amd64 (67.1-6) ... Setting up libfcgi0ldbl:amd64 (2.4.2-2) ... Setting up libmagic-mgc (1:5.39-3) ... Setting up gawk (1:5.0.1+dfsg-1) ... Setting up psmisc (23.4-2) ... Setting up manpages (5.10-1) ... Setting up libtirpc-common (1.3.1-1) ... Setting up perl-modules-5.32 (5.32.1-2) ... Setting up libtasn1-doc (4.16.0-2) ... Setting up libbrotli1:amd64 (1.0.9-2+b2) ... Setting up libsqlite3-0:amd64 (3.34.1-1) ... Setting up libsasl2-modules:amd64 (2.1.27+dfsg-2) ... Setting up libfcgi-bin (2.4.2-2) ... Setting up libnghttp2-14:amd64 (1.42.0-1) ... Setting up libmagic1:amd64 (1:5.39-3) ... Setting up libdeflate0:amd64 (1.7-1) ... Setting up linux-libc-dev:amd64 (5.10.13-1) ... Setting up krb5-locales (1.18.3-4) ... Setting up file (1:5.39-3) ... Setting up libldap-common (2.4.57+dfsg-1) ... Setting up libjbig0:amd64 (2.1-3.1+b2) ... Setting up libjudydebian1 (1.0.5-5+b2) ... Setting up libsnappy1v5:amd64 (1.1.8-1) ... Setting up libkrb5support0:amd64 (1.18.3-4) ... Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-2) ... Setting up libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-1) ... Setting up libjpeg62-turbo:amd64 (1:2.0.5-2) ... Setting up libx11-data (2:1.7.0-2) ... Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2+b2) ... Setting up libncurses6:amd64 (6.2+20201114-2) ... Setting up wamerican (2019.10.06-1) ... Setting up libpng16-16:amd64 (1.6.37-3) ... Setting up libevent-2.1-7:amd64 (2.1.12-stable-1) ... Setting up libwebp6:amd64 (0.6.1-2+b1) ... Setting up libmariadb3:amd64 (1:10.5.6-2) ... Setting up fonts-dejavu-core (2.37-2) ... Setting up libgnutlsxx28:amd64 (3.7.0-6) ... Setting up libpcre2-posix2:amd64 (10.36-2) ... Setting up libncursesw6:amd64 (6.2+20201114-2) ... Setting up libk5crypto3:amd64 (1.18.3-4) ... Setting up libltdl7:amd64 (2.4.6-15) ... Setting up libidn2-dev:amd64 (2.3.0-5) ... Setting up libsasl2-2:amd64 (2.1.27+dfsg-2) ... Setting up lsof (4.93.2+dfsg-1.1) ... Setting up libcrack2:amd64 (2.9.6-3.4) ... Setting up sensible-utils (0.0.14) ... Setting up libcrypt-dev:amd64 (1:4.4.17-1) ... Setting up libxxhash0:amd64 (0.8.0-2) ... Setting up libmpdec3:amd64 (2.5.1-1) ... Setting up libx11-6:amd64 (2:1.7.0-2) ... Setting up libssh2-1:amd64 (1.9.0-2) ... Setting up netbase (6.2) ... Setting up libkrb5-3:amd64 (1.18.3-4) ... Setting up libtiff5:amd64 (4.2.0-1) ... Setting up libaio1:amd64 (0.3.112-9) ... Setting up libc-dev-bin (2.31-9) ... Setting up libtasn1-6-dev:amd64 (4.16.0-2) ... Setting up openssl (1.1.1i-3) ... Setting up publicsuffix (20210108.1309-1) ... Setting up libxml2:amd64 (2.9.10+dfsg-6.3+b1) ... Setting up libprocps8:amd64 (2:3.3.17-1) ... Setting up libp11-kit-dev:amd64 (0.23.22-1) ... Setting up libgdbm6:amd64 (1.19-2) ... Setting up libpopt0:amd64 (1.18-2) ... Setting up libgflags2.2 (2.2.2-2) ... Setting up mariadb-server-core-10.5 (1:10.5.6-2) ... Setting up manpages-dev (5.10-1) ... Setting up libgmp-dev:amd64 (2:6.2.1+dfsg-1) ... Setting up libxpm4:amd64 (1:3.5.12-1) ... Setting up nettle-dev:amd64 (3.7-2) ... Setting up libldap-2.4-2:amd64 (2.4.57+dfsg-1) ... Setting up libmariadbd19:amd64 (1:10.5.6-2) ... Setting up ca-certificates (20210119) ... Updating certificates in /etc/ssl/certs... 129 added, 0 removed; done. Setting up cracklib-runtime (2.9.6-3.4) ... Setting up libunbound8:amd64 (1.13.1-1) ... Setting up libfreetype6:amd64 (2.10.4+dfsg-1) ... Setting up libgssapi-krb5-2:amd64 (1.18.3-4) ... Setting up mariadb-client-core-10.5 (1:10.5.6-2) ... Setting up mariadb-backup (1:10.5.6-2) ... Setting up libgdbm-compat4:amd64 (1.19-2) ... Setting up libodbc1:amd64 (2.3.6-0.1+b1) ... Setting up ucf (3.0043) ... Setting up libperl5.32:amd64 (5.32.1-2) ... Setting up procps (2:3.3.17-1) ... update-alternatives: using /usr/bin/w.procps to provide /usr/bin/w (w) in auto mode Setting up libcurl4:amd64 (7.74.0-1) ... Setting up rocksdb-tools (6.11.4-3) ... Setting up rsync (3.2.3-4) ... Setting up libtirpc3:amd64 (1.3.1-1) ... Setting up libgnutls-dane0:amd64 (3.7.0-6) ... Setting up fontconfig-config (2.13.1-4.2) ... Setting up perl (5.32.1-2) ... Setting up libtirpc-dev:amd64 (1.3.1-1) ... Setting up libio-html-perl (1.004-1) ... Setting up libtimedate-perl (2.3300-1) ... Setting up mariadb-client-10.5 (1:10.5.6-2) ... Setting up libnsl2:amd64 (1.3.0-2) ... Setting up libfcgi-perl:amd64 (0.79+ds-2) ... Setting up libfontconfig1:amd64 (2.13.1-4.2) ... Setting up libterm-readkey-perl (2.38-1+b2) ... Setting up liburi-perl (5.07-1) ... Setting up libdbi-perl:amd64 (1.643-3+b1) ... Setting up libpython3.9-stdlib:amd64 (3.9.1-4) ... Setting up libpython3-stdlib:amd64 (3.9.1-1) ... Setting up mariadb-test-data (1:10.5.6-2) ... Setting up libhttp-date-perl (6.05-1) ... Setting up mariadb-client (1:10.5.6-2) ... Setting up libclone-perl (0.45-1+b1) ... Setting up libhtml-tagset-perl (3.20-4) ... Setting up liblwp-mediatypes-perl (6.04-1) ... Setting up libencode-locale-perl (1.05-1.1) ... Setting up libdbd-mariadb-perl (1.21-3) ... Setting up libwrap0:amd64 (7.6.q-31) ... Setting up socat (1.7.4.1-3) ... Setting up libgd3:amd64 (2.3.0-2) ... Setting up mariadb-plugin-gssapi-client:amd64 (1:10.5.6-2) ... Setting up libnsl-dev:amd64 (1.3.0-2) ... Setting up libhtml-parser-perl (3.75-1+b1) ... Setting up libc6-dev:amd64 (2.31-9) ... Setting up python3.9 (3.9.1-4) ... Setting up libc-devtools (2.31-9) ... Setting up libhttp-message-perl (6.27-1) ... Setting up libgnutls28-dev:amd64 (3.7.0-6) ... Setting up libcgi-pm-perl (4.51-1) ... Setting up python3 (3.9.1-1) ... running python rtupdate hooks for python3.9... running python post-rtupdate hooks for python3.9... Setting up libhtml-template-perl (2.97-1.1) ... Setting up mariadb-server-10.5 (1:10.5.6-2) ... + DEBIAN_SCRIPT_TRACE=1 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + echo '#42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.config configure ' '1>&2' #42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.config configure 1>&2 # Beware that there are two ypwhich one of them needs the 2>/dev/null! if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then db_input high mariadb-server-10.5/nis_warning || true db_go fi ++ which ypwhich + test -n '' + DEBIAN_SCRIPT_TRACE=1 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + echo '#42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.postinst configure ' '1>&2' #42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.postinst configure 1>&2 export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin + export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin # This command can be used as pipe to syslog. With "-s" it also logs to stderr. ERR_LOGGER="logger -p daemon.err -t mariadb-server-$MAJOR_VER.postinst -i" + ERR_LOGGER='logger -p daemon.err -t mariadb-server-10.5.postinst -i' # Specify syslog tag name so it is clear the entry came from this postinst script. # This will make an error in a logged command immediately apparent by aborting # the install, rather than failing silently and leaving a broken install. set -o pipefail + set -o pipefail case "$1" in configure) # This is needed because mysql_install_db removes the pid file in /run # and because changed configuration options should take effect immediately. # In case the server wasn't running at all it should be ok if the stop # script fails. I can't tell at this point because of the cleaned /run. set +e; invoke-rc.d mariadb stop; set -e # An existing /etc/init.d/mysql might be on the system if there was a # previous MySQL or MariaDB installation, since /etc/init.d files are # considered config files and stay around even after the package is removed. # # The install step of this package adds a new /etc/init.d/mariadb file. As # we also want to ensure that there are no old (and potentially outdated) # versions of /etc/init.d/mysql we simply replace it using a copy of the # latest 'mariadb' file. This has also the added benefit that anything that # invokes traditional sysv init with either 'mysql' or 'mariadb' will end up # controlling this newly installed MariaDB, and thus we maintain better # backwards compatiblity. # # Note that the 'Provides' line is also updated to avoid 'insserv' exiting # on failure (when it is run by update-rc.d) because of duplicate service # names. if [ -f "/etc/init.d/mysql" ] && [ -f "/etc/init.d/mariadb" ] then # Copy init file and rename the service name and filename on the fly sed 's/Provides: mariadb/Provides: mysql/g' /etc/init.d/mariadb > /etc/init.d/mysql # NOTE: Number of spaces/tabs is important here! # Confirm if the sed worked if ! grep --quiet "Provides: mysql" /etc/init.d/mysql then # If not, then delete the file to avoid failures later on rm -f /etc/init.d/mysql echo "Warning! Failed creating a mysql named copy of mariadb init.d file" fi fi mysql_statedir=/usr/share/mysql mysql_datadir=/var/lib/mysql mysql_logdir=/var/log/mysql mysql_cfgdir=/etc/mysql mysql_upgradedir=/var/lib/mysql-upgrade # If the following symlink exists, it is a preserved copy the old data dir # created by the preinst script during a upgrade that would have otherwise # been replaced by an empty mysql dir. This should restore it. for dir in DATADIR LOGDIR; do if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_datadir else targetdir=$mysql_logdir fi savelink="$mysql_upgradedir/$dir.link" if [ -L "$savelink" ]; then # If the targetdir was a symlink before we upgraded it is supposed # to be either still be present or not existing anymore now. if [ -L "$targetdir" ]; then rm "$savelink" elif [ ! -d "$targetdir" ]; then mv "$savelink" "$targetdir" else # this should never even happen, but just in case... mysql_tmp=$(mktemp -d -t mysql-symlink-restore-XXXXXX) echo "this is very strange! see $mysql_tmp/README..." >&2 mv "$targetdir" "$mysql_tmp" cat << EOF > "$mysql_tmp/README" If you're reading this, it's most likely because you had replaced /var/lib/mysql with a symlink, then upgraded to a new version of mysql, and then dpkg removed your symlink (see #182747 and others). The mysql packages noticed that this happened, and as a workaround have restored it. However, because /var/lib/mysql seems to have been re-created in the meantime, and because we don't want to rm -rf something we don't know as much about, we are going to leave this unexpected directory here. If your database looks normal, and this is not a symlink to your database, you should be able to blow this all away. EOF fi fi rmdir $mysql_upgradedir 2>/dev/null || true done # Upgrading from mysql.com needs might have the root user as auth_socket. # auto.cnf is a sign of a mysql install, that doesn't exist in mariadb. # We use lsof to protect against concurrent access by mysqld (mariadb has # its own projection). We make sure we're not doing this on a MySQL-8.0 # directory. # This direct update is needed to enable an authentication mechanism to # perform mariadb-upgrade, (MDEV-22678). To keep the impact minimal, we # skip innodb and set key-buffer-size to 0 as it isn't reused. if [ -f "$mysql_datadir"/auto.cnf ] && [ -f "$mysql_datadir"/mysql/user.MYD ] && [ ! lsof -nt "$mysql_datadir"/mysql/user.MYD > /dev/null ] && [ ! -f "$mysql_datadir"/undo_001 ]; then echo "UPDATE mysql.user SET plugin='unix_socket' WHERE plugin='auth_socket';" | /usr/sbin/mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap 2> /dev/null fi # Ensure the existence and right permissions for the database and # log files. Use mkdir option 'Z' to create with correct SELinux context. if [ ! -d "$mysql_statedir" ] && [ ! -L "$mysql_statedir" ]; then mkdir -Z "$mysql_statedir"; fi if [ ! -d "$mysql_datadir" ] && [ ! -L "$mysql_datadir" ]; then mkdir -Z "$mysql_datadir" ; fi if [ ! -d "$mysql_logdir" ] && [ ! -L "$mysql_logdir" ]; then mkdir -Z "$mysql_logdir" ; fi # When creating an ext3 jounal on an already mounted filesystem like e.g. # /var/lib/mysql, you get a .journal file that is not modifyable by chown. # The mysql_statedir must not be writable by the mysql user under any # circumstances as it contains scripts that are executed by root. set +e chown -R 0:0 $mysql_statedir find $mysql_datadir ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql chown -R mysql:adm $mysql_logdir chmod 2750 $mysql_logdir set -e ## Set the correct filesystem ownership for the PAM v2 plugin # eg. /usr/lib/x86_64-linux-gnu/mysql/plugin/auth_pam_tool_dir/ # NOTE! This is security sensitive, don't allow for a race condition. # # 1. Drop privileges of directory # -> At this point only root can see and execute auth_pam_tool chmod 0700 /usr/lib/mysql/plugin/auth_pam_tool_dir # # 2. Make binary setuid # -> At this point only root can run the setuid binary so no escalation here yet chmod 04755 /usr/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool # # 3. Allow user 'mysql' to see and execute auth_pam_tool # -> Now user mysql owns the directory and can see and execute the binary inside # -> Since the binary is setuid, user mysql gets limited root powers here to # run the PAM authetications, which need root (e.g. to validate passwords # against /etc/shadow) chown mysql /usr/lib/mysql/plugin/auth_pam_tool_dir # This is important to avoid dataloss when there is a removed # mysql-server version from Woody lying around which used the same # data directory and then somewhen gets purged by the admin. db_set mariadb-server/postrm_remove_database false || true # Clean up old flags before setting new one rm -f $mysql_datadir/debian-*.flag # Flag data dir to avoid downgrades touch "$mysql_datadir/debian-$MAJOR_VER.flag" # initiate databases. Output is not allowed by debconf :-( # This will fail if we are upgrading an existing database; in this case # mysql_upgrade, called from the /etc/init.d/mariadb start script, will # handle things. # Debian: beware of the bashisms... # Debian: can safely run on upgrades with existing databases set +e bash /usr/bin/mysql_install_db --rpm --cross-bootstrap --user=mysql \ --disable-log-bin --skip-test-db 2>&1 | \ $ERR_LOGGER set -e # To avoid downgrades. touch "$mysql_statedir/debian-$MAJOR_VER.flag" # On new installations root user can connect via unix_socket. # But on upgrades, scripts rely on debian-sys-maint user and # credentials in /etc/mysql/debian.cnf # All tools use --defaults-file=/etc/mysql/debian.cnf # And while it's not needed for new installations, we keep using # --defaults-file option for tools (for the sake of upgrades) # and thus need /etc/mysql/debian.cnf to exist, even if it's empty. # In the long run the goal is to obsolete this file. dc=$mysql_cfgdir/debian.cnf; if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir fi if [ ! -e "$dc" ]; then cat /dev/null > $dc echo "# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE." >>$dc echo "# This file exists only for backwards compatibility for" >>$dc echo "# tools that run '--defaults-file=/etc/mysql/debian.cnf'" >>$dc echo "# and have root level access to the local filesystem." >>$dc echo "# With those permissions one can run 'mariadb' directly" >>$dc echo "# anyway thanks to unix socket authentication and hence" >>$dc echo "# this file is useless. See package README for more info." >>$dc echo "[client]" >>$dc echo "host = localhost" >>$dc echo "user = root" >>$dc echo "[mysql_upgrade]" >>$dc echo "host = localhost" >>$dc echo "user = root" >>$dc echo "# THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE." >>$dc fi # Keep it only root-readable, as it always was chown 0:0 $dc chmod 0600 $dc # If there is a real AppArmor profile, we reload it. # If the default empty profile is installed, then we remove any old # profile that may be loaded. # This allows upgrade from old versions (that have an apparmor profile # on by default) to work both to disable a default profile, and to keep # any profile installed and maintained by users themselves. profile="/etc/apparmor.d/usr.sbin.mariadbd" if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then if grep -q /usr/sbin/mariadbd "$profile" 2>/dev/null ; then apparmor_parser -r "$profile" || true else echo "/usr/sbin/mariadbd { }" | apparmor_parser --remove 2>/dev/null || true fi fi # The introduction of /etc/logrotate.d/mariadb has made the old config # obsolete and it needs to be disabled to prevent logrotate running twice. if [ -f /etc/logrotate.d/mysql-server ] then mv -vf /etc/logrotate.d/mysql-server /etc/logrotate.d/mysql-server.dpkg-bak fi ;; abort-upgrade|abort-remove|abort-configure) ;; triggered) if [ -x "$(command -v systemctl)" ]; then systemctl daemon-reload else invoke-rc.d mariadb restart fi ;; *) echo "postinst called with unknown argument '$1'" 1>&2 exit 1 ;; esac + case "$1" in + set +e + invoke-rc.d mariadb stop test -x /usr/sbin/mariadbd || exit 0 + test -x /usr/sbin/mariadbd . /lib/lsb/init-functions + . /lib/lsb/init-functions # /lib/lsb/init-functions for Debian -*- shell-script -*- # #Copyright (c) 2002-08 Chris Lawrence #All rights reserved. # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions #are met: #1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. #3. Neither the name of the author nor the names of other contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR #BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, #EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. start_daemon () { local force nice pidfile exec args OPTIND force="" nice=0 pidfile=/dev/null OPTIND=1 while getopts fn:p: opt ; do case "$opt" in f) force="force";; n) nice="$OPTARG";; p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ "$1" = '--' ]; then shift fi exec="$1"; shift args="--start --nicelevel $nice --quiet --oknodo" if [ "$force" ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@" elif [ $pidfile ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@" else /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@" fi } pidofproc () { local pidfile base status specified pid OPTIND pidfile= specified= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG" specified="specified" ;; esac done shift $(($OPTIND - 1)) if [ $# -ne 1 ]; then echo "$0: invalid arguments" >&2 return 4 fi base=${1##*/} if [ ! "$specified" ]; then pidfile="/var/run/$base.pid" fi if [ -n "${pidfile:-}" ]; then if [ -e "$pidfile" ]; then if [ -r "$pidfile" ]; then read pid < "$pidfile" if [ -n "${pid:-}" ]; then if $(kill -0 "${pid:-}" 2> /dev/null); then echo "$pid" || true return 0 elif ps "${pid:-}" >/dev/null 2>&1; then echo "$pid" || true return 0 # program is running, but not owned by this user else return 1 # program is dead and /var/run pid file exists fi fi else return 4 # pid file not readable, hence status is unknown. fi else # pid file doesn't exist, try to find the pid nevertheless if [ -x /bin/pidof ] && [ ! "$specified" ]; then status="0" /bin/pidof -c -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi return 0 fi return 3 # specified pid file doesn't exist, program probably stopped fi fi if [ "$specified" ]; then return 3 # almost certain it's not running fi return 4 # Unable to determine status } # start-stop-daemon uses the same algorithm as "pidofproc" above. killproc () { local pidfile sig status base name_param is_term_sig OPTIND pidfile= name_param= is_term_sig= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) base=${1##*/} if [ ! $pidfile ]; then name_param="--name $base --pidfile /var/run/$base.pid" else name_param="--name $base --pidfile $pidfile" fi sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/') sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/') if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then is_term_sig="terminate_signal" fi status=0 if [ ! "$is_term_sig" ]; then if [ -n "$sig" ]; then /sbin/start-stop-daemon --stop --signal "$sig" \ --quiet $name_param || status="$?" else /sbin/start-stop-daemon --stop \ --retry 5 \ --quiet $name_param || status="$?" fi else /sbin/start-stop-daemon --stop --quiet \ --oknodo $name_param || status="$?" fi if [ "$status" = 1 ]; then if [ -z "$sig" ]; then return 0 fi return 3 # program is not running fi if [ "$status" = 0 ] && [ "$is_term_sig" ] && [ "$pidfile" ]; then pidofproc -p "$pidfile" "$1" >/dev/null || rm -f "$pidfile" fi return 0 } # Return LSB status status_of_proc () { local pidfile daemon name status OPTIND pidfile= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ -n "$pidfile" ]; then pidfile="-p $pidfile" fi daemon="$1" name="$2" status="0" pidofproc $pidfile $daemon >/dev/null || status="$?" if [ "$status" = 0 ]; then log_success_msg "$name is running" return 0 elif [ "$status" = 4 ]; then log_failure_msg "could not access PID file for $name" return $status else log_failure_msg "$name is not running" return $status fi } log_use_fancy_output () { TPUT=/usr/bin/tput EXPR=/usr/bin/expr if [ -t 1 ] && [ "x${TERM:-}" != "x" ] && [ "x${TERM:-}" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1 then [ -z $FANCYTTY ] && FANCYTTY=1 || true else FANCYTTY=0 fi case "$FANCYTTY" in 1|Y|yes|true) true;; *) false;; esac } log_success_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ fi log_end_msg 0 } log_failure_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 1 || true } log_warning_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 255 || true } # # NON-LSB HELPER FUNCTIONS # # int get_lsb_header_val (char *scriptpathname, char *key) get_lsb_header_val () { if [ ! -f "$1" ] || [ -z "${2:-}" ]; then return 1 fi LSB_S="### BEGIN INIT INFO" LSB_E="### END INIT INFO" sed -n "/$LSB_S/,/$LSB_E/ s/# $2: \+\(.*\)/\1/p" "$1" } # If the currently running init daemon is upstart, return zero; if the # calling init script belongs to a package which also provides a native # upstart job, it should generally exit non-zero in this case. init_is_upstart() { if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then return 0 fi return 1 } # int log_begin_message (char *message) log_begin_msg () { log_begin_msg_pre "$@" if [ -z "${1:-}" ]; then return 1 fi echo -n "$@" || true log_begin_msg_post "$@" } # Sample usage: # log_daemon_msg "Starting GNOME Login Manager" "gdm" # # On Debian, would output "Starting GNOME Login Manager: gdm" # On Ubuntu, would output " * Starting GNOME Login Manager..." # # If the second argument is omitted, logging suitable for use with # log_progress_msg() is used: # # log_daemon_msg "Starting remote filesystem services" # # On Debian, would output "Starting remote filesystem services:" # On Ubuntu, would output " * Starting remote filesystem services..." log_daemon_msg () { if [ -z "${1:-}" ]; then return 1 fi log_daemon_msg_pre "$@" if [ -z "${2:-}" ]; then echo -n "$1:" || true return fi echo -n "$1: $2" || true log_daemon_msg_post "$@" } # #319739 # # Per policy docs: # # log_daemon_msg "Starting remote file system services" # log_progress_msg "nfsd"; start-stop-daemon --start --quiet nfsd # log_progress_msg "mountd"; start-stop-daemon --start --quiet mountd # log_progress_msg "ugidd"; start-stop-daemon --start --quiet ugidd # log_end_msg 0 # # You could also do something fancy with log_end_msg here based on the # return values of start-stop-daemon; this is left as an exercise for # the reader... # # On Ubuntu, one would expect log_progress_msg to be a no-op. log_progress_msg () { if [ -z "${1:-}" ]; then return 1 fi echo -n " $@" || true } # int log_end_message (int exitstatus) log_end_msg () { # If no arguments were passed, return if [ -z "${1:-}" ]; then return 1 fi local retval retval=$1 log_end_msg_pre "$@" # Only do the fancy stuff if we have an appropriate terminal # and if /usr is already mounted if log_use_fancy_output; then RED=$( $TPUT setaf 1) YELLOW=$( $TPUT setaf 3) NORMAL=$( $TPUT op) else RED='' YELLOW='' NORMAL='' fi if [ $1 -eq 0 ]; then echo "." || true elif [ $1 -eq 255 ]; then /bin/echo -e " ${YELLOW}(warning).${NORMAL}" || true else /bin/echo -e " ${RED}failed!${NORMAL}" || true fi log_end_msg_post "$@" return $retval } log_action_msg () { log_action_msg_pre "$@" echo "$@." || true log_action_msg_post "$@" } log_action_begin_msg () { log_action_begin_msg_pre "$@" echo -n "$@..." || true log_action_begin_msg_post "$@" } log_action_cont_msg () { echo -n "$@..." || true } log_action_end_msg () { local end log_action_end_msg_pre "$@" if [ -z "${2:-}" ]; then end="." else end=" ($2)." fi if [ $1 -eq 0 ]; then echo "done${end}" || true else if log_use_fancy_output; then RED=$( $TPUT setaf 1) NORMAL=$( $TPUT op) /bin/echo -e "${RED}failed${end}${NORMAL}" || true else echo "failed${end}" || true fi fi log_action_end_msg_post "$@" } # Pre&Post empty function declaration, to be overriden from /lib/lsb/init-functions.d/* log_daemon_msg_pre () { :; } log_daemon_msg_post () { :; } log_begin_msg_pre () { :; } log_begin_msg_post () { :; } log_end_msg_pre () { :; } log_end_msg_post () { :; } log_action_msg_pre () { :; } log_action_msg_post () { :; } log_action_begin_msg_pre () { :; } log_action_begin_msg_post () { :; } log_action_end_msg_pre () { :; } log_action_end_msg_post () { :; } # Include hooks from other packages in /lib/lsb/init-functions.d for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do [ -r $hook ] && . $hook || true done +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d ++ for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null) ++ '[' -r /lib/lsb/init-functions.d/00-verbose ']' ++ . /lib/lsb/init-functions.d/00-verbose ## Generated automatically. Do not edit! -*- shell-script -*- vlog_daemon_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_daemon_msg "$@" fi } vlog_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_begin_msg "$@" fi } vlog_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_end_msg "$@" fi } vlog_action_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_msg "$@" fi } vlog_action_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_begin_msg "$@" fi } vlog_action_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_end_msg "$@" fi } # vim: ft=sh FANCYTTY= ++ FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true ++ '[' -e /etc/lsb-base-logging.sh ']' ++ true SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) +++ dirname /etc/init.d/mariadb ++ cd /etc/init.d ++ pwd -P ++ basename /etc/init.d/mariadb + SELF=/etc/init.d/mariadb MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN='/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf' # priority can be overridden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i" + ERR_LOGGER='logger -p daemon.err -t /etc/init.d/mariadb -i' if [ -f /etc/default/mysql ]; then . /etc/default/mysql fi + '[' -f /etc/default/mysql ']' # Also source default/mariadb in case the installation was upgraded from # packages originally installed from MariaDB.org repositories, which have # had support for reading /etc/default/mariadb since March 2016. if [ -f /etc/default/mariadb ]; then . /etc/default/mariadb fi + '[' -f /etc/default/mariadb ']' # Safeguard (relative paths, core dumps..) cd / + cd / umask 077 + umask 077 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want # as many admins e.g. only store a password without a username there and # so break my scripts. export HOME=/etc/mysql/ + export HOME=/etc/mysql/ + HOME=/etc/mysql/ ## Fetch a particular option from mysql's invocation. # # Usage: void mariadbd_get_param option mariadbd_get_param() { /usr/sbin/mariadbd --print-defaults \ | tr " " "\n" \ | grep -- "--$1" \ | tail -n 1 \ | cut -d= -f2 } ## Do some sanity checks before even trying to start mariadbd. sanity_checks() { # check for config file if [ ! -r /etc/mysql/my.cnf ]; then log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER fi # check for diskspace shortage datadir=`mariadbd_get_param datadir` if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER exit 1 fi } ## Checks if there is a server running and if so if it is accessible. # # check_alive insists on a pingable server # check_dead also fails if there is a lost mariadbd in the process list # # Usage: boolean mariadbd_status [check_alive|check_dead] [warn|nowarn] mariadbd_status () { ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) ps_alive=0 pidfile=`mariadbd_get_param pid-file` if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi if [ "$1" = "check_alive" -a $ping_alive = 1 ] || [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then return 0 # EXIT_SUCCESS else if [ "$2" = "warn" ]; then echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug fi return 1 # EXIT_FAILURE fi } # # main() # case "${1:-''}" in 'start') sanity_checks; # Start daemon log_daemon_msg "Starting MariaDB database server" "mariadbd" if mariadbd_status check_alive nowarn; then log_progress_msg "already running" log_end_msg 0 else # Could be removed during boot test -e /run/mysqld || install -m 755 -o mysql -g root -d /run/mysqld # Start MariaDB! /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do sleep 1 if mariadbd_status check_alive nowarn ; then break; fi log_progress_msg "." done if mariadbd_status check_alive warn; then log_end_msg 0 # Now start mysqlcheck or whatever the admin wants. output=$(/etc/mysql/debian-start) if [ -n "$output" ]; then log_action_msg "$output" fi else log_end_msg 1 log_failure_msg "Please take a look at the syslog" fi fi ;; 'stop') # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible # at least for cron, we can rely on it here, too. (although we have # to specify it explicit as e.g. sudo environments points to the normal # users home and not /root) log_daemon_msg "Stopping MariaDB database server" "mariadbd" if ! mariadbd_status check_dead nowarn; then set +e shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? set -e if [ "$r" -ne 0 ]; then log_end_msg 1 [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" log_daemon_msg "Killing MariaDB database server by signal" "mariadbd" killall -15 mariadbd server_down= for i in `seq 1 600`; do sleep 1 if mariadbd_status check_dead nowarn; then server_down=1; break; fi done if test -z "$server_down"; then killall -9 mariadbd; fi fi fi if ! mariadbd_status check_dead warn; then log_end_msg 1 log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!" exit -1 else log_end_msg 0 fi ;; 'restart') set +e; $SELF stop; set -e shift $SELF start "${@}" ;; 'reload'|'force-reload') log_daemon_msg "Reloading MariaDB database server" "mariadbd" $MYADMIN reload log_end_msg 0 ;; 'status') if mariadbd_status check_alive nowarn; then log_action_msg "$($MYADMIN version)" else log_action_msg "MariaDB is stopped." exit 3 fi ;; 'bootstrap') # Bootstrap the cluster, start the first node # that initiates the cluster log_daemon_msg "Bootstrapping the cluster" "mariadbd" $SELF start "${@:2}" --wsrep-new-cluster ;; *) echo "Usage: $SELF start|stop|restart|reload|force-reload|status" exit 1 ;; esac + case "${1:-''}" in + log_daemon_msg 'Stopping MariaDB database server' mariadbd + '[' -z 'Stopping MariaDB database server' ']' + log_daemon_msg_pre 'Stopping MariaDB database server' mariadbd + : + '[' -z mariadbd ']' + echo -n 'Stopping MariaDB database server: mariadbd' Stopping MariaDB database server: mariadbd+ log_daemon_msg_post 'Stopping MariaDB database server' mariadbd + : + mariadbd_status check_dead nowarn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='Could not open required defaults file: /etc/mysql/debian.cnf Fatal error in defaults handling. Program aborted' + ping_alive=0 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ tail -n 1 ++ grep -- --pid-file ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' + '[' check_dead = check_alive -a 0 = 1 ']' + '[' check_dead = check_dead -a 0 = 0 -a 0 = 0 ']' + return 0 + mariadbd_status check_dead warn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='Could not open required defaults file: /etc/mysql/debian.cnf Fatal error in defaults handling. Program aborted' + ping_alive=0 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' + '[' check_dead = check_alive -a 0 = 1 ']' + '[' check_dead = check_dead -a 0 = 0 -a 0 = 0 ']' + return 0 + log_end_msg 0 + '[' -z 0 ']' + local retval + retval=0 + log_end_msg_pre 0 + : + log_use_fancy_output + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + '[' -t 1 ']' + '[' xxterm '!=' x ']' + '[' xxterm '!=' xdumb ']' + '[' -x /usr/bin/tput ']' + '[' -x /usr/bin/expr ']' + /usr/bin/tput hpa 60 + /usr/bin/tput setaf 1 + '[' -z ']' + FANCYTTY=1 + case "$FANCYTTY" in + true ++ /usr/bin/tput setaf 1 + RED='' ++ /usr/bin/tput setaf 3 + YELLOW='' ++ /usr/bin/tput op + NORMAL='' + '[' 0 -eq 0 ']' + echo . . + log_end_msg_post 0 + : + return 0 + set -e + '[' -f /etc/init.d/mysql ']' + mysql_statedir=/usr/share/mysql + mysql_datadir=/var/lib/mysql + mysql_logdir=/var/log/mysql + mysql_cfgdir=/etc/mysql + mysql_upgradedir=/var/lib/mysql-upgrade + for dir in DATADIR LOGDIR + '[' DATADIR = DATADIR ']' + targetdir=/var/lib/mysql + savelink=/var/lib/mysql-upgrade/DATADIR.link + '[' -L /var/lib/mysql-upgrade/DATADIR.link ']' + rmdir /var/lib/mysql-upgrade + true + for dir in DATADIR LOGDIR + '[' LOGDIR = DATADIR ']' + targetdir=/var/log/mysql + savelink=/var/lib/mysql-upgrade/LOGDIR.link + '[' -L /var/lib/mysql-upgrade/LOGDIR.link ']' + rmdir /var/lib/mysql-upgrade + true + '[' -f /var/lib/mysql/auto.cnf ']' + '[' '!' -d /usr/share/mysql ']' + '[' '!' -d /var/lib/mysql ']' + '[' '!' -d /var/log/mysql ']' + '[' '!' -L /var/log/mysql ']' + mkdir -Z /var/log/mysql + set +e + chown -R 0:0 /usr/share/mysql + xargs -0 -r chown mysql ++ id -u mysql + find /var/lib/mysql '!' -uid 101 -print0 + chown -R mysql:adm /var/log/mysql + chmod 2750 /var/log/mysql + set -e + chmod 0700 /usr/lib/mysql/plugin/auth_pam_tool_dir + chmod 04755 /usr/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool + chown mysql /usr/lib/mysql/plugin/auth_pam_tool_dir + db_set mariadb-server/postrm_remove_database false + _db_cmd 'SET mariadb-server/postrm_remove_database' false + _db_internal_IFS=' ' + IFS=' ' + printf '%s\n' 'SET mariadb-server/postrm_remove_database false' + IFS=' ' + read -r _db_internal_line + IFS=' ' + RET='10 mariadb-server/postrm_remove_database doesn'\''t exist' + case ${_db_internal_line%%[ ]*} in + return 10 + true + rm -f '/var/lib/mysql/debian-*.flag' + touch /var/lib/mysql/debian-10.5.flag + set +e + bash /usr/bin/mysql_install_db --rpm --cross-bootstrap --user=mysql --disable-log-bin --skip-test-db + logger -p daemon.err -t mariadb-server-10.5.postinst -i + set -e + touch /usr/share/mysql/debian-10.5.flag + dc=/etc/mysql/debian.cnf + '[' '!' -d /etc/mysql ']' + '[' '!' -e /etc/mysql/debian.cnf ']' + cat /dev/null + echo '# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE.' + echo '# This file exists only for backwards compatibility for' + echo '# tools that run '\''--defaults-file=/etc/mysql/debian.cnf'\''' + echo '# and have root level access to the local filesystem.' + echo '# With those permissions one can run '\''mariadb'\'' directly' + echo '# anyway thanks to unix socket authentication and hence' + echo '# this file is useless. See package README for more info.' + echo '[client]' + echo 'host = localhost' + echo 'user = root' + echo '[mysql_upgrade]' + echo 'host = localhost' + echo 'user = root' + echo '# THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE.' + chown 0:0 /etc/mysql/debian.cnf + chmod 0600 /etc/mysql/debian.cnf + profile=/etc/apparmor.d/usr.sbin.mariadbd + '[' -f /etc/apparmor.d/usr.sbin.mariadbd ']' + aa-status --enabled + '[' -f /etc/logrotate.d/mysql-server ']' db_stop # in case invoke failes + db_stop + echo STOP # dh_systemd_start doesn't emit anything since we still ship /etc/init.d/mariadb. # Thus MariaDB server is started via init.d script, which in turn redirects to # systemctl. If we upgrade from MySQL mysql.service may be masked, which also # means init.d script is disabled. Unmask mysql service explicitly. # Check first that the command exists, to avoid emitting any warning messages. if [ -x "$(command -v deb-systemd-helper)" ]; then deb-systemd-helper unmask mysql.service > /dev/null fi ++ command -v deb-systemd-helper + '[' -x /usr/bin/deb-systemd-helper ']' + deb-systemd-helper unmask mysql.service # Automatically added by dh_systemd_enable/13.2.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'mariadb.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'mariadb.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'mariadb.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'mariadb.service' >/dev/null || true fi fi + '[' configure = configure ']' + deb-systemd-helper unmask mariadb.service + deb-systemd-helper --quiet was-enabled mariadb.service + deb-systemd-helper enable mariadb.service # End automatically added section # Automatically added by dh_systemd_enable/13.2.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed 'mariadb.service'; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'mariadb.service' >/dev/null || true if deb-systemd-helper --quiet was-enabled 'mariadb.service'; then # Create new symlinks, if any. deb-systemd-helper enable 'mariadb.service' >/dev/null || true fi fi # Update the statefile to add new symlinks (if any), which need to be cleaned # up on purge. Also remove old symlinks. deb-systemd-helper update-state 'mariadb.service' >/dev/null || true fi + '[' configure = configure ']' + deb-systemd-helper debian-installed mariadb.service + deb-systemd-helper unmask mariadb.service + deb-systemd-helper --quiet was-enabled mariadb.service + deb-systemd-helper enable mariadb.service + deb-systemd-helper update-state mariadb.service # End automatically added section # Automatically added by dh_installinit/13.2.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "/etc/init.d/mariadb" ]; then update-rc.d mariadb defaults 19 21 >/dev/null || exit 1 fi fi + '[' configure = configure ']' + '[' -x /etc/init.d/mariadb ']' + update-rc.d mariadb defaults 19 21 # End automatically added section # Modified dh_systemd_start snippet that's not added automatically if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true deb-systemd-invoke start mariadb.service >/dev/null || true # Modified dh_installinit snippet to only run with sysvinit elif [ -x "/etc/init.d/mariadb" ]; then if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then invoke-rc.d mariadb start || exit $? fi fi + '[' -d /run/systemd/system ']' + '[' -x /etc/init.d/mariadb ']' + '[' configure = configure ']' + invoke-rc.d mariadb start test -x /usr/sbin/mariadbd || exit 0 + test -x /usr/sbin/mariadbd . /lib/lsb/init-functions + . /lib/lsb/init-functions # /lib/lsb/init-functions for Debian -*- shell-script -*- # #Copyright (c) 2002-08 Chris Lawrence #All rights reserved. # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions #are met: #1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. #3. Neither the name of the author nor the names of other contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR #BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, #EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. start_daemon () { local force nice pidfile exec args OPTIND force="" nice=0 pidfile=/dev/null OPTIND=1 while getopts fn:p: opt ; do case "$opt" in f) force="force";; n) nice="$OPTARG";; p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ "$1" = '--' ]; then shift fi exec="$1"; shift args="--start --nicelevel $nice --quiet --oknodo" if [ "$force" ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@" elif [ $pidfile ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@" else /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@" fi } pidofproc () { local pidfile base status specified pid OPTIND pidfile= specified= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG" specified="specified" ;; esac done shift $(($OPTIND - 1)) if [ $# -ne 1 ]; then echo "$0: invalid arguments" >&2 return 4 fi base=${1##*/} if [ ! "$specified" ]; then pidfile="/var/run/$base.pid" fi if [ -n "${pidfile:-}" ]; then if [ -e "$pidfile" ]; then if [ -r "$pidfile" ]; then read pid < "$pidfile" if [ -n "${pid:-}" ]; then if $(kill -0 "${pid:-}" 2> /dev/null); then echo "$pid" || true return 0 elif ps "${pid:-}" >/dev/null 2>&1; then echo "$pid" || true return 0 # program is running, but not owned by this user else return 1 # program is dead and /var/run pid file exists fi fi else return 4 # pid file not readable, hence status is unknown. fi else # pid file doesn't exist, try to find the pid nevertheless if [ -x /bin/pidof ] && [ ! "$specified" ]; then status="0" /bin/pidof -c -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi return 0 fi return 3 # specified pid file doesn't exist, program probably stopped fi fi if [ "$specified" ]; then return 3 # almost certain it's not running fi return 4 # Unable to determine status } # start-stop-daemon uses the same algorithm as "pidofproc" above. killproc () { local pidfile sig status base name_param is_term_sig OPTIND pidfile= name_param= is_term_sig= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) base=${1##*/} if [ ! $pidfile ]; then name_param="--name $base --pidfile /var/run/$base.pid" else name_param="--name $base --pidfile $pidfile" fi sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/') sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/') if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then is_term_sig="terminate_signal" fi status=0 if [ ! "$is_term_sig" ]; then if [ -n "$sig" ]; then /sbin/start-stop-daemon --stop --signal "$sig" \ --quiet $name_param || status="$?" else /sbin/start-stop-daemon --stop \ --retry 5 \ --quiet $name_param || status="$?" fi else /sbin/start-stop-daemon --stop --quiet \ --oknodo $name_param || status="$?" fi if [ "$status" = 1 ]; then if [ -z "$sig" ]; then return 0 fi return 3 # program is not running fi if [ "$status" = 0 ] && [ "$is_term_sig" ] && [ "$pidfile" ]; then pidofproc -p "$pidfile" "$1" >/dev/null || rm -f "$pidfile" fi return 0 } # Return LSB status status_of_proc () { local pidfile daemon name status OPTIND pidfile= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ -n "$pidfile" ]; then pidfile="-p $pidfile" fi daemon="$1" name="$2" status="0" pidofproc $pidfile $daemon >/dev/null || status="$?" if [ "$status" = 0 ]; then log_success_msg "$name is running" return 0 elif [ "$status" = 4 ]; then log_failure_msg "could not access PID file for $name" return $status else log_failure_msg "$name is not running" return $status fi } log_use_fancy_output () { TPUT=/usr/bin/tput EXPR=/usr/bin/expr if [ -t 1 ] && [ "x${TERM:-}" != "x" ] && [ "x${TERM:-}" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1 then [ -z $FANCYTTY ] && FANCYTTY=1 || true else FANCYTTY=0 fi case "$FANCYTTY" in 1|Y|yes|true) true;; *) false;; esac } log_success_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ fi log_end_msg 0 } log_failure_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 1 || true } log_warning_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 255 || true } # # NON-LSB HELPER FUNCTIONS # # int get_lsb_header_val (char *scriptpathname, char *key) get_lsb_header_val () { if [ ! -f "$1" ] || [ -z "${2:-}" ]; then return 1 fi LSB_S="### BEGIN INIT INFO" LSB_E="### END INIT INFO" sed -n "/$LSB_S/,/$LSB_E/ s/# $2: \+\(.*\)/\1/p" "$1" } # If the currently running init daemon is upstart, return zero; if the # calling init script belongs to a package which also provides a native # upstart job, it should generally exit non-zero in this case. init_is_upstart() { if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then return 0 fi return 1 } # int log_begin_message (char *message) log_begin_msg () { log_begin_msg_pre "$@" if [ -z "${1:-}" ]; then return 1 fi echo -n "$@" || true log_begin_msg_post "$@" } # Sample usage: # log_daemon_msg "Starting GNOME Login Manager" "gdm" # # On Debian, would output "Starting GNOME Login Manager: gdm" # On Ubuntu, would output " * Starting GNOME Login Manager..." # # If the second argument is omitted, logging suitable for use with # log_progress_msg() is used: # # log_daemon_msg "Starting remote filesystem services" # # On Debian, would output "Starting remote filesystem services:" # On Ubuntu, would output " * Starting remote filesystem services..." log_daemon_msg () { if [ -z "${1:-}" ]; then return 1 fi log_daemon_msg_pre "$@" if [ -z "${2:-}" ]; then echo -n "$1:" || true return fi echo -n "$1: $2" || true log_daemon_msg_post "$@" } # #319739 # # Per policy docs: # # log_daemon_msg "Starting remote file system services" # log_progress_msg "nfsd"; start-stop-daemon --start --quiet nfsd # log_progress_msg "mountd"; start-stop-daemon --start --quiet mountd # log_progress_msg "ugidd"; start-stop-daemon --start --quiet ugidd # log_end_msg 0 # # You could also do something fancy with log_end_msg here based on the # return values of start-stop-daemon; this is left as an exercise for # the reader... # # On Ubuntu, one would expect log_progress_msg to be a no-op. log_progress_msg () { if [ -z "${1:-}" ]; then return 1 fi echo -n " $@" || true } # int log_end_message (int exitstatus) log_end_msg () { # If no arguments were passed, return if [ -z "${1:-}" ]; then return 1 fi local retval retval=$1 log_end_msg_pre "$@" # Only do the fancy stuff if we have an appropriate terminal # and if /usr is already mounted if log_use_fancy_output; then RED=$( $TPUT setaf 1) YELLOW=$( $TPUT setaf 3) NORMAL=$( $TPUT op) else RED='' YELLOW='' NORMAL='' fi if [ $1 -eq 0 ]; then echo "." || true elif [ $1 -eq 255 ]; then /bin/echo -e " ${YELLOW}(warning).${NORMAL}" || true else /bin/echo -e " ${RED}failed!${NORMAL}" || true fi log_end_msg_post "$@" return $retval } log_action_msg () { log_action_msg_pre "$@" echo "$@." || true log_action_msg_post "$@" } log_action_begin_msg () { log_action_begin_msg_pre "$@" echo -n "$@..." || true log_action_begin_msg_post "$@" } log_action_cont_msg () { echo -n "$@..." || true } log_action_end_msg () { local end log_action_end_msg_pre "$@" if [ -z "${2:-}" ]; then end="." else end=" ($2)." fi if [ $1 -eq 0 ]; then echo "done${end}" || true else if log_use_fancy_output; then RED=$( $TPUT setaf 1) NORMAL=$( $TPUT op) /bin/echo -e "${RED}failed${end}${NORMAL}" || true else echo "failed${end}" || true fi fi log_action_end_msg_post "$@" } # Pre&Post empty function declaration, to be overriden from /lib/lsb/init-functions.d/* log_daemon_msg_pre () { :; } log_daemon_msg_post () { :; } log_begin_msg_pre () { :; } log_begin_msg_post () { :; } log_end_msg_pre () { :; } log_end_msg_post () { :; } log_action_msg_pre () { :; } log_action_msg_post () { :; } log_action_begin_msg_pre () { :; } log_action_begin_msg_post () { :; } log_action_end_msg_pre () { :; } log_action_end_msg_post () { :; } # Include hooks from other packages in /lib/lsb/init-functions.d for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do [ -r $hook ] && . $hook || true done +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d ++ for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null) ++ '[' -r /lib/lsb/init-functions.d/00-verbose ']' ++ . /lib/lsb/init-functions.d/00-verbose ## Generated automatically. Do not edit! -*- shell-script -*- vlog_daemon_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_daemon_msg "$@" fi } vlog_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_begin_msg "$@" fi } vlog_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_end_msg "$@" fi } vlog_action_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_msg "$@" fi } vlog_action_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_begin_msg "$@" fi } vlog_action_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_end_msg "$@" fi } # vim: ft=sh FANCYTTY= ++ FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true ++ '[' -e /etc/lsb-base-logging.sh ']' ++ true SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) +++ dirname /etc/init.d/mariadb ++ cd /etc/init.d ++ pwd -P ++ basename /etc/init.d/mariadb + SELF=/etc/init.d/mariadb MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN='/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf' # priority can be overridden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i" + ERR_LOGGER='logger -p daemon.err -t /etc/init.d/mariadb -i' if [ -f /etc/default/mysql ]; then . /etc/default/mysql fi + '[' -f /etc/default/mysql ']' # Also source default/mariadb in case the installation was upgraded from # packages originally installed from MariaDB.org repositories, which have # had support for reading /etc/default/mariadb since March 2016. if [ -f /etc/default/mariadb ]; then . /etc/default/mariadb fi + '[' -f /etc/default/mariadb ']' # Safeguard (relative paths, core dumps..) cd / + cd / umask 077 + umask 077 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want # as many admins e.g. only store a password without a username there and # so break my scripts. export HOME=/etc/mysql/ + export HOME=/etc/mysql/ + HOME=/etc/mysql/ ## Fetch a particular option from mysql's invocation. # # Usage: void mariadbd_get_param option mariadbd_get_param() { /usr/sbin/mariadbd --print-defaults \ | tr " " "\n" \ | grep -- "--$1" \ | tail -n 1 \ | cut -d= -f2 } ## Do some sanity checks before even trying to start mariadbd. sanity_checks() { # check for config file if [ ! -r /etc/mysql/my.cnf ]; then log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER fi # check for diskspace shortage datadir=`mariadbd_get_param datadir` if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER exit 1 fi } ## Checks if there is a server running and if so if it is accessible. # # check_alive insists on a pingable server # check_dead also fails if there is a lost mariadbd in the process list # # Usage: boolean mariadbd_status [check_alive|check_dead] [warn|nowarn] mariadbd_status () { ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) ps_alive=0 pidfile=`mariadbd_get_param pid-file` if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi if [ "$1" = "check_alive" -a $ping_alive = 1 ] || [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then return 0 # EXIT_SUCCESS else if [ "$2" = "warn" ]; then echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug fi return 1 # EXIT_FAILURE fi } # # main() # case "${1:-''}" in 'start') sanity_checks; # Start daemon log_daemon_msg "Starting MariaDB database server" "mariadbd" if mariadbd_status check_alive nowarn; then log_progress_msg "already running" log_end_msg 0 else # Could be removed during boot test -e /run/mysqld || install -m 755 -o mysql -g root -d /run/mysqld # Start MariaDB! /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do sleep 1 if mariadbd_status check_alive nowarn ; then break; fi log_progress_msg "." done if mariadbd_status check_alive warn; then log_end_msg 0 # Now start mysqlcheck or whatever the admin wants. output=$(/etc/mysql/debian-start) if [ -n "$output" ]; then log_action_msg "$output" fi else log_end_msg 1 log_failure_msg "Please take a look at the syslog" fi fi ;; 'stop') # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible # at least for cron, we can rely on it here, too. (although we have # to specify it explicit as e.g. sudo environments points to the normal # users home and not /root) log_daemon_msg "Stopping MariaDB database server" "mariadbd" if ! mariadbd_status check_dead nowarn; then set +e shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? set -e if [ "$r" -ne 0 ]; then log_end_msg 1 [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" log_daemon_msg "Killing MariaDB database server by signal" "mariadbd" killall -15 mariadbd server_down= for i in `seq 1 600`; do sleep 1 if mariadbd_status check_dead nowarn; then server_down=1; break; fi done if test -z "$server_down"; then killall -9 mariadbd; fi fi fi if ! mariadbd_status check_dead warn; then log_end_msg 1 log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!" exit -1 else log_end_msg 0 fi ;; 'restart') set +e; $SELF stop; set -e shift $SELF start "${@}" ;; 'reload'|'force-reload') log_daemon_msg "Reloading MariaDB database server" "mariadbd" $MYADMIN reload log_end_msg 0 ;; 'status') if mariadbd_status check_alive nowarn; then log_action_msg "$($MYADMIN version)" else log_action_msg "MariaDB is stopped." exit 3 fi ;; 'bootstrap') # Bootstrap the cluster, start the first node # that initiates the cluster log_daemon_msg "Bootstrapping the cluster" "mariadbd" $SELF start "${@:2}" --wsrep-new-cluster ;; *) echo "Usage: $SELF start|stop|restart|reload|force-reload|status" exit 1 ;; esac + case "${1:-''}" in + sanity_checks + '[' '!' -r /etc/mysql/my.cnf ']' ++ mariadbd_get_param datadir ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --datadir ++ tail -n 1 ++ cut -d= -f2 + datadir=/var/lib/mysql + LC_ALL=C + BLOCKSIZE= + df --portability /var/lib/mysql/. + tail -n 1 + awk '{ exit ($4>4096) }' + log_daemon_msg 'Starting MariaDB database server' mariadbd + '[' -z 'Starting MariaDB database server' ']' + log_daemon_msg_pre 'Starting MariaDB database server' mariadbd + : + '[' -z mariadbd ']' + echo -n 'Starting MariaDB database server: mariadbd' Starting MariaDB database server: mariadbd+ log_daemon_msg_post 'Starting MariaDB database server' mariadbd + : + mariadbd_status check_alive nowarn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='/usr/bin/mysqladmin: connect to server at '\''localhost'\'' failed error: '\''Can'\''t connect to local MySQL server through socket '\''/run/mysqld/mysqld.sock'\'' (2)'\'' Check that mysqld is running and that the socket: '\''/run/mysqld/mysqld.sock'\'' exists!' + ping_alive=0 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' + '[' check_alive = check_alive -a 0 = 1 ']' + '[' check_alive = check_dead -a 0 = 0 -a 0 = 0 ']' + '[' nowarn = warn ']' + return 1 + test -e /run/mysqld + install -m 755 -o mysql -g root -d /run/mysqld + /usr/bin/mysqld_safe + logger -p daemon.err -t /etc/init.d/mariadb -i ++ seq 1 30 + for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}") + sleep 1 + mariadbd_status check_alive nowarn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='mysqld is alive' + ping_alive=1 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' ++ cat /run/mysqld/mysqld.pid + ps 4105 + ps_alive=1 + '[' check_alive = check_alive -a 1 = 1 ']' + return 0 + break + mariadbd_status check_alive warn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='mysqld is alive' + ping_alive=1 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' ++ cat /run/mysqld/mysqld.pid + ps 4105 + ps_alive=1 + '[' check_alive = check_alive -a 1 = 1 ']' + return 0 + log_end_msg 0 + '[' -z 0 ']' + local retval + retval=0 + log_end_msg_pre 0 + : + log_use_fancy_output + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + '[' -t 1 ']' + '[' xxterm '!=' x ']' + '[' xxterm '!=' xdumb ']' + '[' -x /usr/bin/tput ']' + '[' -x /usr/bin/expr ']' + /usr/bin/tput hpa 60 + /usr/bin/tput setaf 1 + '[' -z ']' + FANCYTTY=1 + case "$FANCYTTY" in + true ++ /usr/bin/tput setaf 1 + RED='' ++ /usr/bin/tput setaf 3 + YELLOW='' ++ /usr/bin/tput op + NORMAL='' + '[' 0 -eq 0 ']' + echo . . + log_end_msg_post 0 + : + return 0 ++ /etc/mysql/debian-start + output= + '[' -n '' ']' Setting up mariadb-server (1:10.5.6-2) ... Setting up python3-mysqldb (1.4.4-2+b3) ... Setting up mariadb-plugin-cracklib-password-check (1:10.5.6-2) ... Setting up mariadb-test (1:10.5.6-2) ... Setting up mariadb-plugin-mroonga (1:10.5.6-2) ... Setting up mariadb-plugin-oqgraph (1:10.5.6-2) ... Setting up mariadb-plugin-rocksdb (1:10.5.6-2) ... Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-2) ... Setting up mariadb-plugin-gssapi-server (1:10.5.6-2) ... Setting up libcgi-fast-perl (1:2.15-1) ... Setting up mariadb-plugin-s3 (1:10.5.6-2) ... Setting up mariadb-plugin-spider (1:10.5.6-2) ... Setting up libmariadb-dev (1:10.5.6-2) ... Setting up libmariadb-dev-compat:amd64 (1:10.5.6-2) ... Setting up libmariadbd-dev (1:10.5.6-2) ... Setting up odbcinst (2.3.6-0.1+b1) ... Setting up odbcinst1debian2:amd64 (2.3.6-0.1+b1) ... Setting up unixodbc (2.3.6-0.1+b1) ... Setting up mariadb-plugin-connect (1:10.5.6-2) ... Processing triggers for libc-bin (2.31-5) ... Processing triggers for ca-certificates (20210119) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. Processing triggers for mariadb-server-10.5 (1:10.5.6-2) ... + DEBIAN_SCRIPT_TRACE=1 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + echo '#42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.config configure /etc/mysql' '1>&2' #42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.config configure /etc/mysql 1>&2 # Beware that there are two ypwhich one of them needs the 2>/dev/null! if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then db_input high mariadb-server-10.5/nis_warning || true db_go fi ++ which ypwhich + test -n '' + DEBIAN_SCRIPT_TRACE=1 ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + echo '#42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.postinst triggered /etc/mysql' '1>&2' #42#DEBUG# RUNNING /var/lib/dpkg/info/mariadb-server-10.5.postinst triggered /etc/mysql 1>&2 export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin + export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin # This command can be used as pipe to syslog. With "-s" it also logs to stderr. ERR_LOGGER="logger -p daemon.err -t mariadb-server-$MAJOR_VER.postinst -i" + ERR_LOGGER='logger -p daemon.err -t mariadb-server-10.5.postinst -i' # Specify syslog tag name so it is clear the entry came from this postinst script. # This will make an error in a logged command immediately apparent by aborting # the install, rather than failing silently and leaving a broken install. set -o pipefail + set -o pipefail case "$1" in configure) # This is needed because mysql_install_db removes the pid file in /run # and because changed configuration options should take effect immediately. # In case the server wasn't running at all it should be ok if the stop # script fails. I can't tell at this point because of the cleaned /run. set +e; invoke-rc.d mariadb stop; set -e # An existing /etc/init.d/mysql might be on the system if there was a # previous MySQL or MariaDB installation, since /etc/init.d files are # considered config files and stay around even after the package is removed. # # The install step of this package adds a new /etc/init.d/mariadb file. As # we also want to ensure that there are no old (and potentially outdated) # versions of /etc/init.d/mysql we simply replace it using a copy of the # latest 'mariadb' file. This has also the added benefit that anything that # invokes traditional sysv init with either 'mysql' or 'mariadb' will end up # controlling this newly installed MariaDB, and thus we maintain better # backwards compatiblity. # # Note that the 'Provides' line is also updated to avoid 'insserv' exiting # on failure (when it is run by update-rc.d) because of duplicate service # names. if [ -f "/etc/init.d/mysql" ] && [ -f "/etc/init.d/mariadb" ] then # Copy init file and rename the service name and filename on the fly sed 's/Provides: mariadb/Provides: mysql/g' /etc/init.d/mariadb > /etc/init.d/mysql # NOTE: Number of spaces/tabs is important here! # Confirm if the sed worked if ! grep --quiet "Provides: mysql" /etc/init.d/mysql then # If not, then delete the file to avoid failures later on rm -f /etc/init.d/mysql echo "Warning! Failed creating a mysql named copy of mariadb init.d file" fi fi mysql_statedir=/usr/share/mysql mysql_datadir=/var/lib/mysql mysql_logdir=/var/log/mysql mysql_cfgdir=/etc/mysql mysql_upgradedir=/var/lib/mysql-upgrade # If the following symlink exists, it is a preserved copy the old data dir # created by the preinst script during a upgrade that would have otherwise # been replaced by an empty mysql dir. This should restore it. for dir in DATADIR LOGDIR; do if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_datadir else targetdir=$mysql_logdir fi savelink="$mysql_upgradedir/$dir.link" if [ -L "$savelink" ]; then # If the targetdir was a symlink before we upgraded it is supposed # to be either still be present or not existing anymore now. if [ -L "$targetdir" ]; then rm "$savelink" elif [ ! -d "$targetdir" ]; then mv "$savelink" "$targetdir" else # this should never even happen, but just in case... mysql_tmp=$(mktemp -d -t mysql-symlink-restore-XXXXXX) echo "this is very strange! see $mysql_tmp/README..." >&2 mv "$targetdir" "$mysql_tmp" cat << EOF > "$mysql_tmp/README" If you're reading this, it's most likely because you had replaced /var/lib/mysql with a symlink, then upgraded to a new version of mysql, and then dpkg removed your symlink (see #182747 and others). The mysql packages noticed that this happened, and as a workaround have restored it. However, because /var/lib/mysql seems to have been re-created in the meantime, and because we don't want to rm -rf something we don't know as much about, we are going to leave this unexpected directory here. If your database looks normal, and this is not a symlink to your database, you should be able to blow this all away. EOF fi fi rmdir $mysql_upgradedir 2>/dev/null || true done # Upgrading from mysql.com needs might have the root user as auth_socket. # auto.cnf is a sign of a mysql install, that doesn't exist in mariadb. # We use lsof to protect against concurrent access by mysqld (mariadb has # its own projection). We make sure we're not doing this on a MySQL-8.0 # directory. # This direct update is needed to enable an authentication mechanism to # perform mariadb-upgrade, (MDEV-22678). To keep the impact minimal, we # skip innodb and set key-buffer-size to 0 as it isn't reused. if [ -f "$mysql_datadir"/auto.cnf ] && [ -f "$mysql_datadir"/mysql/user.MYD ] && [ ! lsof -nt "$mysql_datadir"/mysql/user.MYD > /dev/null ] && [ ! -f "$mysql_datadir"/undo_001 ]; then echo "UPDATE mysql.user SET plugin='unix_socket' WHERE plugin='auth_socket';" | /usr/sbin/mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap 2> /dev/null fi # Ensure the existence and right permissions for the database and # log files. Use mkdir option 'Z' to create with correct SELinux context. if [ ! -d "$mysql_statedir" ] && [ ! -L "$mysql_statedir" ]; then mkdir -Z "$mysql_statedir"; fi if [ ! -d "$mysql_datadir" ] && [ ! -L "$mysql_datadir" ]; then mkdir -Z "$mysql_datadir" ; fi if [ ! -d "$mysql_logdir" ] && [ ! -L "$mysql_logdir" ]; then mkdir -Z "$mysql_logdir" ; fi # When creating an ext3 jounal on an already mounted filesystem like e.g. # /var/lib/mysql, you get a .journal file that is not modifyable by chown. # The mysql_statedir must not be writable by the mysql user under any # circumstances as it contains scripts that are executed by root. set +e chown -R 0:0 $mysql_statedir find $mysql_datadir ! -uid "$(id -u mysql)" -print0 | xargs -0 -r chown mysql chown -R mysql:adm $mysql_logdir chmod 2750 $mysql_logdir set -e ## Set the correct filesystem ownership for the PAM v2 plugin # eg. /usr/lib/x86_64-linux-gnu/mysql/plugin/auth_pam_tool_dir/ # NOTE! This is security sensitive, don't allow for a race condition. # # 1. Drop privileges of directory # -> At this point only root can see and execute auth_pam_tool chmod 0700 /usr/lib/mysql/plugin/auth_pam_tool_dir # # 2. Make binary setuid # -> At this point only root can run the setuid binary so no escalation here yet chmod 04755 /usr/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool # # 3. Allow user 'mysql' to see and execute auth_pam_tool # -> Now user mysql owns the directory and can see and execute the binary inside # -> Since the binary is setuid, user mysql gets limited root powers here to # run the PAM authetications, which need root (e.g. to validate passwords # against /etc/shadow) chown mysql /usr/lib/mysql/plugin/auth_pam_tool_dir # This is important to avoid dataloss when there is a removed # mysql-server version from Woody lying around which used the same # data directory and then somewhen gets purged by the admin. db_set mariadb-server/postrm_remove_database false || true # Clean up old flags before setting new one rm -f $mysql_datadir/debian-*.flag # Flag data dir to avoid downgrades touch "$mysql_datadir/debian-$MAJOR_VER.flag" # initiate databases. Output is not allowed by debconf :-( # This will fail if we are upgrading an existing database; in this case # mysql_upgrade, called from the /etc/init.d/mariadb start script, will # handle things. # Debian: beware of the bashisms... # Debian: can safely run on upgrades with existing databases set +e bash /usr/bin/mysql_install_db --rpm --cross-bootstrap --user=mysql \ --disable-log-bin --skip-test-db 2>&1 | \ $ERR_LOGGER set -e # To avoid downgrades. touch "$mysql_statedir/debian-$MAJOR_VER.flag" # On new installations root user can connect via unix_socket. # But on upgrades, scripts rely on debian-sys-maint user and # credentials in /etc/mysql/debian.cnf # All tools use --defaults-file=/etc/mysql/debian.cnf # And while it's not needed for new installations, we keep using # --defaults-file option for tools (for the sake of upgrades) # and thus need /etc/mysql/debian.cnf to exist, even if it's empty. # In the long run the goal is to obsolete this file. dc=$mysql_cfgdir/debian.cnf; if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir fi if [ ! -e "$dc" ]; then cat /dev/null > $dc echo "# THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE." >>$dc echo "# This file exists only for backwards compatibility for" >>$dc echo "# tools that run '--defaults-file=/etc/mysql/debian.cnf'" >>$dc echo "# and have root level access to the local filesystem." >>$dc echo "# With those permissions one can run 'mariadb' directly" >>$dc echo "# anyway thanks to unix socket authentication and hence" >>$dc echo "# this file is useless. See package README for more info." >>$dc echo "[client]" >>$dc echo "host = localhost" >>$dc echo "user = root" >>$dc echo "[mysql_upgrade]" >>$dc echo "host = localhost" >>$dc echo "user = root" >>$dc echo "# THIS FILE WILL BE REMOVED IN A FUTURE DEBIAN RELEASE." >>$dc fi # Keep it only root-readable, as it always was chown 0:0 $dc chmod 0600 $dc # If there is a real AppArmor profile, we reload it. # If the default empty profile is installed, then we remove any old # profile that may be loaded. # This allows upgrade from old versions (that have an apparmor profile # on by default) to work both to disable a default profile, and to keep # any profile installed and maintained by users themselves. profile="/etc/apparmor.d/usr.sbin.mariadbd" if [ -f "$profile" ] && aa-status --enabled 2>/dev/null; then if grep -q /usr/sbin/mariadbd "$profile" 2>/dev/null ; then apparmor_parser -r "$profile" || true else echo "/usr/sbin/mariadbd { }" | apparmor_parser --remove 2>/dev/null || true fi fi # The introduction of /etc/logrotate.d/mariadb has made the old config # obsolete and it needs to be disabled to prevent logrotate running twice. if [ -f /etc/logrotate.d/mysql-server ] then mv -vf /etc/logrotate.d/mysql-server /etc/logrotate.d/mysql-server.dpkg-bak fi ;; abort-upgrade|abort-remove|abort-configure) ;; triggered) if [ -x "$(command -v systemctl)" ]; then systemctl daemon-reload else invoke-rc.d mariadb restart fi ;; *) echo "postinst called with unknown argument '$1'" 1>&2 exit 1 ;; esac + case "$1" in ++ command -v systemctl + '[' -x '' ']' + invoke-rc.d mariadb restart test -x /usr/sbin/mariadbd || exit 0 + test -x /usr/sbin/mariadbd . /lib/lsb/init-functions + . /lib/lsb/init-functions # /lib/lsb/init-functions for Debian -*- shell-script -*- # #Copyright (c) 2002-08 Chris Lawrence #All rights reserved. # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions #are met: #1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. #3. Neither the name of the author nor the names of other contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR #BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, #EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. start_daemon () { local force nice pidfile exec args OPTIND force="" nice=0 pidfile=/dev/null OPTIND=1 while getopts fn:p: opt ; do case "$opt" in f) force="force";; n) nice="$OPTARG";; p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ "$1" = '--' ]; then shift fi exec="$1"; shift args="--start --nicelevel $nice --quiet --oknodo" if [ "$force" ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@" elif [ $pidfile ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@" else /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@" fi } pidofproc () { local pidfile base status specified pid OPTIND pidfile= specified= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG" specified="specified" ;; esac done shift $(($OPTIND - 1)) if [ $# -ne 1 ]; then echo "$0: invalid arguments" >&2 return 4 fi base=${1##*/} if [ ! "$specified" ]; then pidfile="/var/run/$base.pid" fi if [ -n "${pidfile:-}" ]; then if [ -e "$pidfile" ]; then if [ -r "$pidfile" ]; then read pid < "$pidfile" if [ -n "${pid:-}" ]; then if $(kill -0 "${pid:-}" 2> /dev/null); then echo "$pid" || true return 0 elif ps "${pid:-}" >/dev/null 2>&1; then echo "$pid" || true return 0 # program is running, but not owned by this user else return 1 # program is dead and /var/run pid file exists fi fi else return 4 # pid file not readable, hence status is unknown. fi else # pid file doesn't exist, try to find the pid nevertheless if [ -x /bin/pidof ] && [ ! "$specified" ]; then status="0" /bin/pidof -c -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi return 0 fi return 3 # specified pid file doesn't exist, program probably stopped fi fi if [ "$specified" ]; then return 3 # almost certain it's not running fi return 4 # Unable to determine status } # start-stop-daemon uses the same algorithm as "pidofproc" above. killproc () { local pidfile sig status base name_param is_term_sig OPTIND pidfile= name_param= is_term_sig= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) base=${1##*/} if [ ! $pidfile ]; then name_param="--name $base --pidfile /var/run/$base.pid" else name_param="--name $base --pidfile $pidfile" fi sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/') sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/') if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then is_term_sig="terminate_signal" fi status=0 if [ ! "$is_term_sig" ]; then if [ -n "$sig" ]; then /sbin/start-stop-daemon --stop --signal "$sig" \ --quiet $name_param || status="$?" else /sbin/start-stop-daemon --stop \ --retry 5 \ --quiet $name_param || status="$?" fi else /sbin/start-stop-daemon --stop --quiet \ --oknodo $name_param || status="$?" fi if [ "$status" = 1 ]; then if [ -z "$sig" ]; then return 0 fi return 3 # program is not running fi if [ "$status" = 0 ] && [ "$is_term_sig" ] && [ "$pidfile" ]; then pidofproc -p "$pidfile" "$1" >/dev/null || rm -f "$pidfile" fi return 0 } # Return LSB status status_of_proc () { local pidfile daemon name status OPTIND pidfile= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ -n "$pidfile" ]; then pidfile="-p $pidfile" fi daemon="$1" name="$2" status="0" pidofproc $pidfile $daemon >/dev/null || status="$?" if [ "$status" = 0 ]; then log_success_msg "$name is running" return 0 elif [ "$status" = 4 ]; then log_failure_msg "could not access PID file for $name" return $status else log_failure_msg "$name is not running" return $status fi } log_use_fancy_output () { TPUT=/usr/bin/tput EXPR=/usr/bin/expr if [ -t 1 ] && [ "x${TERM:-}" != "x" ] && [ "x${TERM:-}" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1 then [ -z $FANCYTTY ] && FANCYTTY=1 || true else FANCYTTY=0 fi case "$FANCYTTY" in 1|Y|yes|true) true;; *) false;; esac } log_success_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ fi log_end_msg 0 } log_failure_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 1 || true } log_warning_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 255 || true } # # NON-LSB HELPER FUNCTIONS # # int get_lsb_header_val (char *scriptpathname, char *key) get_lsb_header_val () { if [ ! -f "$1" ] || [ -z "${2:-}" ]; then return 1 fi LSB_S="### BEGIN INIT INFO" LSB_E="### END INIT INFO" sed -n "/$LSB_S/,/$LSB_E/ s/# $2: \+\(.*\)/\1/p" "$1" } # If the currently running init daemon is upstart, return zero; if the # calling init script belongs to a package which also provides a native # upstart job, it should generally exit non-zero in this case. init_is_upstart() { if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then return 0 fi return 1 } # int log_begin_message (char *message) log_begin_msg () { log_begin_msg_pre "$@" if [ -z "${1:-}" ]; then return 1 fi echo -n "$@" || true log_begin_msg_post "$@" } # Sample usage: # log_daemon_msg "Starting GNOME Login Manager" "gdm" # # On Debian, would output "Starting GNOME Login Manager: gdm" # On Ubuntu, would output " * Starting GNOME Login Manager..." # # If the second argument is omitted, logging suitable for use with # log_progress_msg() is used: # # log_daemon_msg "Starting remote filesystem services" # # On Debian, would output "Starting remote filesystem services:" # On Ubuntu, would output " * Starting remote filesystem services..." log_daemon_msg () { if [ -z "${1:-}" ]; then return 1 fi log_daemon_msg_pre "$@" if [ -z "${2:-}" ]; then echo -n "$1:" || true return fi echo -n "$1: $2" || true log_daemon_msg_post "$@" } # #319739 # # Per policy docs: # # log_daemon_msg "Starting remote file system services" # log_progress_msg "nfsd"; start-stop-daemon --start --quiet nfsd # log_progress_msg "mountd"; start-stop-daemon --start --quiet mountd # log_progress_msg "ugidd"; start-stop-daemon --start --quiet ugidd # log_end_msg 0 # # You could also do something fancy with log_end_msg here based on the # return values of start-stop-daemon; this is left as an exercise for # the reader... # # On Ubuntu, one would expect log_progress_msg to be a no-op. log_progress_msg () { if [ -z "${1:-}" ]; then return 1 fi echo -n " $@" || true } # int log_end_message (int exitstatus) log_end_msg () { # If no arguments were passed, return if [ -z "${1:-}" ]; then return 1 fi local retval retval=$1 log_end_msg_pre "$@" # Only do the fancy stuff if we have an appropriate terminal # and if /usr is already mounted if log_use_fancy_output; then RED=$( $TPUT setaf 1) YELLOW=$( $TPUT setaf 3) NORMAL=$( $TPUT op) else RED='' YELLOW='' NORMAL='' fi if [ $1 -eq 0 ]; then echo "." || true elif [ $1 -eq 255 ]; then /bin/echo -e " ${YELLOW}(warning).${NORMAL}" || true else /bin/echo -e " ${RED}failed!${NORMAL}" || true fi log_end_msg_post "$@" return $retval } log_action_msg () { log_action_msg_pre "$@" echo "$@." || true log_action_msg_post "$@" } log_action_begin_msg () { log_action_begin_msg_pre "$@" echo -n "$@..." || true log_action_begin_msg_post "$@" } log_action_cont_msg () { echo -n "$@..." || true } log_action_end_msg () { local end log_action_end_msg_pre "$@" if [ -z "${2:-}" ]; then end="." else end=" ($2)." fi if [ $1 -eq 0 ]; then echo "done${end}" || true else if log_use_fancy_output; then RED=$( $TPUT setaf 1) NORMAL=$( $TPUT op) /bin/echo -e "${RED}failed${end}${NORMAL}" || true else echo "failed${end}" || true fi fi log_action_end_msg_post "$@" } # Pre&Post empty function declaration, to be overriden from /lib/lsb/init-functions.d/* log_daemon_msg_pre () { :; } log_daemon_msg_post () { :; } log_begin_msg_pre () { :; } log_begin_msg_post () { :; } log_end_msg_pre () { :; } log_end_msg_post () { :; } log_action_msg_pre () { :; } log_action_msg_post () { :; } log_action_begin_msg_pre () { :; } log_action_begin_msg_post () { :; } log_action_end_msg_pre () { :; } log_action_end_msg_post () { :; } # Include hooks from other packages in /lib/lsb/init-functions.d for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do [ -r $hook ] && . $hook || true done +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d ++ for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null) ++ '[' -r /lib/lsb/init-functions.d/00-verbose ']' ++ . /lib/lsb/init-functions.d/00-verbose ## Generated automatically. Do not edit! -*- shell-script -*- vlog_daemon_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_daemon_msg "$@" fi } vlog_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_begin_msg "$@" fi } vlog_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_end_msg "$@" fi } vlog_action_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_msg "$@" fi } vlog_action_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_begin_msg "$@" fi } vlog_action_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_end_msg "$@" fi } # vim: ft=sh FANCYTTY= ++ FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true ++ '[' -e /etc/lsb-base-logging.sh ']' ++ true SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) +++ dirname /etc/init.d/mariadb ++ cd /etc/init.d ++ pwd -P ++ basename /etc/init.d/mariadb + SELF=/etc/init.d/mariadb MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN='/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf' # priority can be overridden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i" + ERR_LOGGER='logger -p daemon.err -t /etc/init.d/mariadb -i' if [ -f /etc/default/mysql ]; then . /etc/default/mysql fi + '[' -f /etc/default/mysql ']' # Also source default/mariadb in case the installation was upgraded from # packages originally installed from MariaDB.org repositories, which have # had support for reading /etc/default/mariadb since March 2016. if [ -f /etc/default/mariadb ]; then . /etc/default/mariadb fi + '[' -f /etc/default/mariadb ']' # Safeguard (relative paths, core dumps..) cd / + cd / umask 077 + umask 077 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want # as many admins e.g. only store a password without a username there and # so break my scripts. export HOME=/etc/mysql/ + export HOME=/etc/mysql/ + HOME=/etc/mysql/ ## Fetch a particular option from mysql's invocation. # # Usage: void mariadbd_get_param option mariadbd_get_param() { /usr/sbin/mariadbd --print-defaults \ | tr " " "\n" \ | grep -- "--$1" \ | tail -n 1 \ | cut -d= -f2 } ## Do some sanity checks before even trying to start mariadbd. sanity_checks() { # check for config file if [ ! -r /etc/mysql/my.cnf ]; then log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER fi # check for diskspace shortage datadir=`mariadbd_get_param datadir` if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER exit 1 fi } ## Checks if there is a server running and if so if it is accessible. # # check_alive insists on a pingable server # check_dead also fails if there is a lost mariadbd in the process list # # Usage: boolean mariadbd_status [check_alive|check_dead] [warn|nowarn] mariadbd_status () { ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) ps_alive=0 pidfile=`mariadbd_get_param pid-file` if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi if [ "$1" = "check_alive" -a $ping_alive = 1 ] || [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then return 0 # EXIT_SUCCESS else if [ "$2" = "warn" ]; then echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug fi return 1 # EXIT_FAILURE fi } # # main() # case "${1:-''}" in 'start') sanity_checks; # Start daemon log_daemon_msg "Starting MariaDB database server" "mariadbd" if mariadbd_status check_alive nowarn; then log_progress_msg "already running" log_end_msg 0 else # Could be removed during boot test -e /run/mysqld || install -m 755 -o mysql -g root -d /run/mysqld # Start MariaDB! /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do sleep 1 if mariadbd_status check_alive nowarn ; then break; fi log_progress_msg "." done if mariadbd_status check_alive warn; then log_end_msg 0 # Now start mysqlcheck or whatever the admin wants. output=$(/etc/mysql/debian-start) if [ -n "$output" ]; then log_action_msg "$output" fi else log_end_msg 1 log_failure_msg "Please take a look at the syslog" fi fi ;; 'stop') # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible # at least for cron, we can rely on it here, too. (although we have # to specify it explicit as e.g. sudo environments points to the normal # users home and not /root) log_daemon_msg "Stopping MariaDB database server" "mariadbd" if ! mariadbd_status check_dead nowarn; then set +e shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? set -e if [ "$r" -ne 0 ]; then log_end_msg 1 [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" log_daemon_msg "Killing MariaDB database server by signal" "mariadbd" killall -15 mariadbd server_down= for i in `seq 1 600`; do sleep 1 if mariadbd_status check_dead nowarn; then server_down=1; break; fi done if test -z "$server_down"; then killall -9 mariadbd; fi fi fi if ! mariadbd_status check_dead warn; then log_end_msg 1 log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!" exit -1 else log_end_msg 0 fi ;; 'restart') set +e; $SELF stop; set -e shift $SELF start "${@}" ;; 'reload'|'force-reload') log_daemon_msg "Reloading MariaDB database server" "mariadbd" $MYADMIN reload log_end_msg 0 ;; 'status') if mariadbd_status check_alive nowarn; then log_action_msg "$($MYADMIN version)" else log_action_msg "MariaDB is stopped." exit 3 fi ;; 'bootstrap') # Bootstrap the cluster, start the first node # that initiates the cluster log_daemon_msg "Bootstrapping the cluster" "mariadbd" $SELF start "${@:2}" --wsrep-new-cluster ;; *) echo "Usage: $SELF start|stop|restart|reload|force-reload|status" exit 1 ;; esac + case "${1:-''}" in + set +e + /etc/init.d/mariadb stop test -x /usr/sbin/mariadbd || exit 0 + test -x /usr/sbin/mariadbd . /lib/lsb/init-functions + . /lib/lsb/init-functions # /lib/lsb/init-functions for Debian -*- shell-script -*- # #Copyright (c) 2002-08 Chris Lawrence #All rights reserved. # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions #are met: #1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. #3. Neither the name of the author nor the names of other contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR #BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, #EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. start_daemon () { local force nice pidfile exec args OPTIND force="" nice=0 pidfile=/dev/null OPTIND=1 while getopts fn:p: opt ; do case "$opt" in f) force="force";; n) nice="$OPTARG";; p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ "$1" = '--' ]; then shift fi exec="$1"; shift args="--start --nicelevel $nice --quiet --oknodo" if [ "$force" ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@" elif [ $pidfile ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@" else /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@" fi } pidofproc () { local pidfile base status specified pid OPTIND pidfile= specified= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG" specified="specified" ;; esac done shift $(($OPTIND - 1)) if [ $# -ne 1 ]; then echo "$0: invalid arguments" >&2 return 4 fi base=${1##*/} if [ ! "$specified" ]; then pidfile="/var/run/$base.pid" fi if [ -n "${pidfile:-}" ]; then if [ -e "$pidfile" ]; then if [ -r "$pidfile" ]; then read pid < "$pidfile" if [ -n "${pid:-}" ]; then if $(kill -0 "${pid:-}" 2> /dev/null); then echo "$pid" || true return 0 elif ps "${pid:-}" >/dev/null 2>&1; then echo "$pid" || true return 0 # program is running, but not owned by this user else return 1 # program is dead and /var/run pid file exists fi fi else return 4 # pid file not readable, hence status is unknown. fi else # pid file doesn't exist, try to find the pid nevertheless if [ -x /bin/pidof ] && [ ! "$specified" ]; then status="0" /bin/pidof -c -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi return 0 fi return 3 # specified pid file doesn't exist, program probably stopped fi fi if [ "$specified" ]; then return 3 # almost certain it's not running fi return 4 # Unable to determine status } # start-stop-daemon uses the same algorithm as "pidofproc" above. killproc () { local pidfile sig status base name_param is_term_sig OPTIND pidfile= name_param= is_term_sig= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) base=${1##*/} if [ ! $pidfile ]; then name_param="--name $base --pidfile /var/run/$base.pid" else name_param="--name $base --pidfile $pidfile" fi sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/') sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/') if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then is_term_sig="terminate_signal" fi status=0 if [ ! "$is_term_sig" ]; then if [ -n "$sig" ]; then /sbin/start-stop-daemon --stop --signal "$sig" \ --quiet $name_param || status="$?" else /sbin/start-stop-daemon --stop \ --retry 5 \ --quiet $name_param || status="$?" fi else /sbin/start-stop-daemon --stop --quiet \ --oknodo $name_param || status="$?" fi if [ "$status" = 1 ]; then if [ -z "$sig" ]; then return 0 fi return 3 # program is not running fi if [ "$status" = 0 ] && [ "$is_term_sig" ] && [ "$pidfile" ]; then pidofproc -p "$pidfile" "$1" >/dev/null || rm -f "$pidfile" fi return 0 } # Return LSB status status_of_proc () { local pidfile daemon name status OPTIND pidfile= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ -n "$pidfile" ]; then pidfile="-p $pidfile" fi daemon="$1" name="$2" status="0" pidofproc $pidfile $daemon >/dev/null || status="$?" if [ "$status" = 0 ]; then log_success_msg "$name is running" return 0 elif [ "$status" = 4 ]; then log_failure_msg "could not access PID file for $name" return $status else log_failure_msg "$name is not running" return $status fi } log_use_fancy_output () { TPUT=/usr/bin/tput EXPR=/usr/bin/expr if [ -t 1 ] && [ "x${TERM:-}" != "x" ] && [ "x${TERM:-}" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1 then [ -z $FANCYTTY ] && FANCYTTY=1 || true else FANCYTTY=0 fi case "$FANCYTTY" in 1|Y|yes|true) true;; *) false;; esac } log_success_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ fi log_end_msg 0 } log_failure_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 1 || true } log_warning_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 255 || true } # # NON-LSB HELPER FUNCTIONS # # int get_lsb_header_val (char *scriptpathname, char *key) get_lsb_header_val () { if [ ! -f "$1" ] || [ -z "${2:-}" ]; then return 1 fi LSB_S="### BEGIN INIT INFO" LSB_E="### END INIT INFO" sed -n "/$LSB_S/,/$LSB_E/ s/# $2: \+\(.*\)/\1/p" "$1" } # If the currently running init daemon is upstart, return zero; if the # calling init script belongs to a package which also provides a native # upstart job, it should generally exit non-zero in this case. init_is_upstart() { if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then return 0 fi return 1 } # int log_begin_message (char *message) log_begin_msg () { log_begin_msg_pre "$@" if [ -z "${1:-}" ]; then return 1 fi echo -n "$@" || true log_begin_msg_post "$@" } # Sample usage: # log_daemon_msg "Starting GNOME Login Manager" "gdm" # # On Debian, would output "Starting GNOME Login Manager: gdm" # On Ubuntu, would output " * Starting GNOME Login Manager..." # # If the second argument is omitted, logging suitable for use with # log_progress_msg() is used: # # log_daemon_msg "Starting remote filesystem services" # # On Debian, would output "Starting remote filesystem services:" # On Ubuntu, would output " * Starting remote filesystem services..." log_daemon_msg () { if [ -z "${1:-}" ]; then return 1 fi log_daemon_msg_pre "$@" if [ -z "${2:-}" ]; then echo -n "$1:" || true return fi echo -n "$1: $2" || true log_daemon_msg_post "$@" } # #319739 # # Per policy docs: # # log_daemon_msg "Starting remote file system services" # log_progress_msg "nfsd"; start-stop-daemon --start --quiet nfsd # log_progress_msg "mountd"; start-stop-daemon --start --quiet mountd # log_progress_msg "ugidd"; start-stop-daemon --start --quiet ugidd # log_end_msg 0 # # You could also do something fancy with log_end_msg here based on the # return values of start-stop-daemon; this is left as an exercise for # the reader... # # On Ubuntu, one would expect log_progress_msg to be a no-op. log_progress_msg () { if [ -z "${1:-}" ]; then return 1 fi echo -n " $@" || true } # int log_end_message (int exitstatus) log_end_msg () { # If no arguments were passed, return if [ -z "${1:-}" ]; then return 1 fi local retval retval=$1 log_end_msg_pre "$@" # Only do the fancy stuff if we have an appropriate terminal # and if /usr is already mounted if log_use_fancy_output; then RED=$( $TPUT setaf 1) YELLOW=$( $TPUT setaf 3) NORMAL=$( $TPUT op) else RED='' YELLOW='' NORMAL='' fi if [ $1 -eq 0 ]; then echo "." || true elif [ $1 -eq 255 ]; then /bin/echo -e " ${YELLOW}(warning).${NORMAL}" || true else /bin/echo -e " ${RED}failed!${NORMAL}" || true fi log_end_msg_post "$@" return $retval } log_action_msg () { log_action_msg_pre "$@" echo "$@." || true log_action_msg_post "$@" } log_action_begin_msg () { log_action_begin_msg_pre "$@" echo -n "$@..." || true log_action_begin_msg_post "$@" } log_action_cont_msg () { echo -n "$@..." || true } log_action_end_msg () { local end log_action_end_msg_pre "$@" if [ -z "${2:-}" ]; then end="." else end=" ($2)." fi if [ $1 -eq 0 ]; then echo "done${end}" || true else if log_use_fancy_output; then RED=$( $TPUT setaf 1) NORMAL=$( $TPUT op) /bin/echo -e "${RED}failed${end}${NORMAL}" || true else echo "failed${end}" || true fi fi log_action_end_msg_post "$@" } # Pre&Post empty function declaration, to be overriden from /lib/lsb/init-functions.d/* log_daemon_msg_pre () { :; } log_daemon_msg_post () { :; } log_begin_msg_pre () { :; } log_begin_msg_post () { :; } log_end_msg_pre () { :; } log_end_msg_post () { :; } log_action_msg_pre () { :; } log_action_msg_post () { :; } log_action_begin_msg_pre () { :; } log_action_begin_msg_post () { :; } log_action_end_msg_pre () { :; } log_action_end_msg_post () { :; } # Include hooks from other packages in /lib/lsb/init-functions.d for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do [ -r $hook ] && . $hook || true done +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d ++ for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null) ++ '[' -r /lib/lsb/init-functions.d/00-verbose ']' ++ . /lib/lsb/init-functions.d/00-verbose ## Generated automatically. Do not edit! -*- shell-script -*- vlog_daemon_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_daemon_msg "$@" fi } vlog_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_begin_msg "$@" fi } vlog_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_end_msg "$@" fi } vlog_action_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_msg "$@" fi } vlog_action_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_begin_msg "$@" fi } vlog_action_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_end_msg "$@" fi } # vim: ft=sh FANCYTTY= ++ FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true ++ '[' -e /etc/lsb-base-logging.sh ']' ++ true SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) +++ dirname /etc/init.d/mariadb ++ cd /etc/init.d ++ pwd -P ++ basename /etc/init.d/mariadb + SELF=/etc/init.d/mariadb MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN='/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf' # priority can be overridden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i" + ERR_LOGGER='logger -p daemon.err -t /etc/init.d/mariadb -i' if [ -f /etc/default/mysql ]; then . /etc/default/mysql fi + '[' -f /etc/default/mysql ']' # Also source default/mariadb in case the installation was upgraded from # packages originally installed from MariaDB.org repositories, which have # had support for reading /etc/default/mariadb since March 2016. if [ -f /etc/default/mariadb ]; then . /etc/default/mariadb fi + '[' -f /etc/default/mariadb ']' # Safeguard (relative paths, core dumps..) cd / + cd / umask 077 + umask 077 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want # as many admins e.g. only store a password without a username there and # so break my scripts. export HOME=/etc/mysql/ + export HOME=/etc/mysql/ + HOME=/etc/mysql/ ## Fetch a particular option from mysql's invocation. # # Usage: void mariadbd_get_param option mariadbd_get_param() { /usr/sbin/mariadbd --print-defaults \ | tr " " "\n" \ | grep -- "--$1" \ | tail -n 1 \ | cut -d= -f2 } ## Do some sanity checks before even trying to start mariadbd. sanity_checks() { # check for config file if [ ! -r /etc/mysql/my.cnf ]; then log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER fi # check for diskspace shortage datadir=`mariadbd_get_param datadir` if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER exit 1 fi } ## Checks if there is a server running and if so if it is accessible. # # check_alive insists on a pingable server # check_dead also fails if there is a lost mariadbd in the process list # # Usage: boolean mariadbd_status [check_alive|check_dead] [warn|nowarn] mariadbd_status () { ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) ps_alive=0 pidfile=`mariadbd_get_param pid-file` if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi if [ "$1" = "check_alive" -a $ping_alive = 1 ] || [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then return 0 # EXIT_SUCCESS else if [ "$2" = "warn" ]; then echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug fi return 1 # EXIT_FAILURE fi } # # main() # case "${1:-''}" in 'start') sanity_checks; # Start daemon log_daemon_msg "Starting MariaDB database server" "mariadbd" if mariadbd_status check_alive nowarn; then log_progress_msg "already running" log_end_msg 0 else # Could be removed during boot test -e /run/mysqld || install -m 755 -o mysql -g root -d /run/mysqld # Start MariaDB! /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do sleep 1 if mariadbd_status check_alive nowarn ; then break; fi log_progress_msg "." done if mariadbd_status check_alive warn; then log_end_msg 0 # Now start mysqlcheck or whatever the admin wants. output=$(/etc/mysql/debian-start) if [ -n "$output" ]; then log_action_msg "$output" fi else log_end_msg 1 log_failure_msg "Please take a look at the syslog" fi fi ;; 'stop') # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible # at least for cron, we can rely on it here, too. (although we have # to specify it explicit as e.g. sudo environments points to the normal # users home and not /root) log_daemon_msg "Stopping MariaDB database server" "mariadbd" if ! mariadbd_status check_dead nowarn; then set +e shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? set -e if [ "$r" -ne 0 ]; then log_end_msg 1 [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" log_daemon_msg "Killing MariaDB database server by signal" "mariadbd" killall -15 mariadbd server_down= for i in `seq 1 600`; do sleep 1 if mariadbd_status check_dead nowarn; then server_down=1; break; fi done if test -z "$server_down"; then killall -9 mariadbd; fi fi fi if ! mariadbd_status check_dead warn; then log_end_msg 1 log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!" exit -1 else log_end_msg 0 fi ;; 'restart') set +e; $SELF stop; set -e shift $SELF start "${@}" ;; 'reload'|'force-reload') log_daemon_msg "Reloading MariaDB database server" "mariadbd" $MYADMIN reload log_end_msg 0 ;; 'status') if mariadbd_status check_alive nowarn; then log_action_msg "$($MYADMIN version)" else log_action_msg "MariaDB is stopped." exit 3 fi ;; 'bootstrap') # Bootstrap the cluster, start the first node # that initiates the cluster log_daemon_msg "Bootstrapping the cluster" "mariadbd" $SELF start "${@:2}" --wsrep-new-cluster ;; *) echo "Usage: $SELF start|stop|restart|reload|force-reload|status" exit 1 ;; esac + case "${1:-''}" in + log_daemon_msg 'Stopping MariaDB database server' mariadbd + '[' -z 'Stopping MariaDB database server' ']' + log_daemon_msg_pre 'Stopping MariaDB database server' mariadbd + : + '[' -z mariadbd ']' + echo -n 'Stopping MariaDB database server: mariadbd' Stopping MariaDB database server: mariadbd+ log_daemon_msg_post 'Stopping MariaDB database server' mariadbd + : + mariadbd_status check_dead nowarn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='mysqld is alive' + ping_alive=1 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' ++ cat /run/mysqld/mysqld.pid + ps 4105 + ps_alive=1 + '[' check_dead = check_alive -a 1 = 1 ']' + '[' check_dead = check_dead -a 1 = 0 -a 1 = 0 ']' + '[' nowarn = warn ']' + return 1 + set +e ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf shutdown ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) + shutdown_out= + r=0 + set -e + '[' 0 -ne 0 ']' + mariadbd_status check_dead warn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='/usr/bin/mysqladmin: connect to server at '\''localhost'\'' failed error: '\''Can'\''t connect to local MySQL server through socket '\''/run/mysqld/mysqld.sock'\'' (2)'\'' Check that mysqld is running and that the socket: '\''/run/mysqld/mysqld.sock'\'' exists!' + ping_alive=0 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' + '[' check_dead = check_alive -a 0 = 1 ']' + '[' check_dead = check_dead -a 0 = 0 -a 0 = 0 ']' + return 0 + log_end_msg 0 + '[' -z 0 ']' + local retval + retval=0 + log_end_msg_pre 0 + : + log_use_fancy_output + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + '[' -t 1 ']' + '[' xxterm '!=' x ']' + '[' xxterm '!=' xdumb ']' + '[' -x /usr/bin/tput ']' + '[' -x /usr/bin/expr ']' + /usr/bin/tput hpa 60 + /usr/bin/tput setaf 1 + '[' -z ']' + FANCYTTY=1 + case "$FANCYTTY" in + true ++ /usr/bin/tput setaf 1 + RED='' ++ /usr/bin/tput setaf 3 + YELLOW='' ++ /usr/bin/tput op + NORMAL='' + '[' 0 -eq 0 ']' + echo . . + log_end_msg_post 0 + : + return 0 + set -e + shift + /etc/init.d/mariadb start test -x /usr/sbin/mariadbd || exit 0 + test -x /usr/sbin/mariadbd . /lib/lsb/init-functions + . /lib/lsb/init-functions # /lib/lsb/init-functions for Debian -*- shell-script -*- # #Copyright (c) 2002-08 Chris Lawrence #All rights reserved. # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions #are met: #1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. #3. Neither the name of the author nor the names of other contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED #WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR #BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE #OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, #EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. start_daemon () { local force nice pidfile exec args OPTIND force="" nice=0 pidfile=/dev/null OPTIND=1 while getopts fn:p: opt ; do case "$opt" in f) force="force";; n) nice="$OPTARG";; p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ "$1" = '--' ]; then shift fi exec="$1"; shift args="--start --nicelevel $nice --quiet --oknodo" if [ "$force" ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --startas $exec --pidfile /dev/null -- "$@" elif [ $pidfile ]; then /sbin/start-stop-daemon $args \ --chdir "$PWD" --exec $exec --oknodo --pidfile "$pidfile" -- "$@" else /sbin/start-stop-daemon $args --chdir "$PWD" --exec $exec -- "$@" fi } pidofproc () { local pidfile base status specified pid OPTIND pidfile= specified= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG" specified="specified" ;; esac done shift $(($OPTIND - 1)) if [ $# -ne 1 ]; then echo "$0: invalid arguments" >&2 return 4 fi base=${1##*/} if [ ! "$specified" ]; then pidfile="/var/run/$base.pid" fi if [ -n "${pidfile:-}" ]; then if [ -e "$pidfile" ]; then if [ -r "$pidfile" ]; then read pid < "$pidfile" if [ -n "${pid:-}" ]; then if $(kill -0 "${pid:-}" 2> /dev/null); then echo "$pid" || true return 0 elif ps "${pid:-}" >/dev/null 2>&1; then echo "$pid" || true return 0 # program is running, but not owned by this user else return 1 # program is dead and /var/run pid file exists fi fi else return 4 # pid file not readable, hence status is unknown. fi else # pid file doesn't exist, try to find the pid nevertheless if [ -x /bin/pidof ] && [ ! "$specified" ]; then status="0" /bin/pidof -c -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi return 0 fi return 3 # specified pid file doesn't exist, program probably stopped fi fi if [ "$specified" ]; then return 3 # almost certain it's not running fi return 4 # Unable to determine status } # start-stop-daemon uses the same algorithm as "pidofproc" above. killproc () { local pidfile sig status base name_param is_term_sig OPTIND pidfile= name_param= is_term_sig= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) base=${1##*/} if [ ! $pidfile ]; then name_param="--name $base --pidfile /var/run/$base.pid" else name_param="--name $base --pidfile $pidfile" fi sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/') sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/') if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then is_term_sig="terminate_signal" fi status=0 if [ ! "$is_term_sig" ]; then if [ -n "$sig" ]; then /sbin/start-stop-daemon --stop --signal "$sig" \ --quiet $name_param || status="$?" else /sbin/start-stop-daemon --stop \ --retry 5 \ --quiet $name_param || status="$?" fi else /sbin/start-stop-daemon --stop --quiet \ --oknodo $name_param || status="$?" fi if [ "$status" = 1 ]; then if [ -z "$sig" ]; then return 0 fi return 3 # program is not running fi if [ "$status" = 0 ] && [ "$is_term_sig" ] && [ "$pidfile" ]; then pidofproc -p "$pidfile" "$1" >/dev/null || rm -f "$pidfile" fi return 0 } # Return LSB status status_of_proc () { local pidfile daemon name status OPTIND pidfile= OPTIND=1 while getopts p: opt ; do case "$opt" in p) pidfile="$OPTARG";; esac done shift $(($OPTIND - 1)) if [ -n "$pidfile" ]; then pidfile="-p $pidfile" fi daemon="$1" name="$2" status="0" pidofproc $pidfile $daemon >/dev/null || status="$?" if [ "$status" = 0 ]; then log_success_msg "$name is running" return 0 elif [ "$status" = 4 ]; then log_failure_msg "could not access PID file for $name" return $status else log_failure_msg "$name is not running" return $status fi } log_use_fancy_output () { TPUT=/usr/bin/tput EXPR=/usr/bin/expr if [ -t 1 ] && [ "x${TERM:-}" != "x" ] && [ "x${TERM:-}" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1 then [ -z $FANCYTTY ] && FANCYTTY=1 || true else FANCYTTY=0 fi case "$FANCYTTY" in 1|Y|yes|true) true;; *) false;; esac } log_success_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ fi log_end_msg 0 } log_failure_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 1 || true } log_warning_msg () { if [ -n "${1:-}" ]; then log_begin_msg $@ "..." fi log_end_msg 255 || true } # # NON-LSB HELPER FUNCTIONS # # int get_lsb_header_val (char *scriptpathname, char *key) get_lsb_header_val () { if [ ! -f "$1" ] || [ -z "${2:-}" ]; then return 1 fi LSB_S="### BEGIN INIT INFO" LSB_E="### END INIT INFO" sed -n "/$LSB_S/,/$LSB_E/ s/# $2: \+\(.*\)/\1/p" "$1" } # If the currently running init daemon is upstart, return zero; if the # calling init script belongs to a package which also provides a native # upstart job, it should generally exit non-zero in this case. init_is_upstart() { if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then return 0 fi return 1 } # int log_begin_message (char *message) log_begin_msg () { log_begin_msg_pre "$@" if [ -z "${1:-}" ]; then return 1 fi echo -n "$@" || true log_begin_msg_post "$@" } # Sample usage: # log_daemon_msg "Starting GNOME Login Manager" "gdm" # # On Debian, would output "Starting GNOME Login Manager: gdm" # On Ubuntu, would output " * Starting GNOME Login Manager..." # # If the second argument is omitted, logging suitable for use with # log_progress_msg() is used: # # log_daemon_msg "Starting remote filesystem services" # # On Debian, would output "Starting remote filesystem services:" # On Ubuntu, would output " * Starting remote filesystem services..." log_daemon_msg () { if [ -z "${1:-}" ]; then return 1 fi log_daemon_msg_pre "$@" if [ -z "${2:-}" ]; then echo -n "$1:" || true return fi echo -n "$1: $2" || true log_daemon_msg_post "$@" } # #319739 # # Per policy docs: # # log_daemon_msg "Starting remote file system services" # log_progress_msg "nfsd"; start-stop-daemon --start --quiet nfsd # log_progress_msg "mountd"; start-stop-daemon --start --quiet mountd # log_progress_msg "ugidd"; start-stop-daemon --start --quiet ugidd # log_end_msg 0 # # You could also do something fancy with log_end_msg here based on the # return values of start-stop-daemon; this is left as an exercise for # the reader... # # On Ubuntu, one would expect log_progress_msg to be a no-op. log_progress_msg () { if [ -z "${1:-}" ]; then return 1 fi echo -n " $@" || true } # int log_end_message (int exitstatus) log_end_msg () { # If no arguments were passed, return if [ -z "${1:-}" ]; then return 1 fi local retval retval=$1 log_end_msg_pre "$@" # Only do the fancy stuff if we have an appropriate terminal # and if /usr is already mounted if log_use_fancy_output; then RED=$( $TPUT setaf 1) YELLOW=$( $TPUT setaf 3) NORMAL=$( $TPUT op) else RED='' YELLOW='' NORMAL='' fi if [ $1 -eq 0 ]; then echo "." || true elif [ $1 -eq 255 ]; then /bin/echo -e " ${YELLOW}(warning).${NORMAL}" || true else /bin/echo -e " ${RED}failed!${NORMAL}" || true fi log_end_msg_post "$@" return $retval } log_action_msg () { log_action_msg_pre "$@" echo "$@." || true log_action_msg_post "$@" } log_action_begin_msg () { log_action_begin_msg_pre "$@" echo -n "$@..." || true log_action_begin_msg_post "$@" } log_action_cont_msg () { echo -n "$@..." || true } log_action_end_msg () { local end log_action_end_msg_pre "$@" if [ -z "${2:-}" ]; then end="." else end=" ($2)." fi if [ $1 -eq 0 ]; then echo "done${end}" || true else if log_use_fancy_output; then RED=$( $TPUT setaf 1) NORMAL=$( $TPUT op) /bin/echo -e "${RED}failed${end}${NORMAL}" || true else echo "failed${end}" || true fi fi log_action_end_msg_post "$@" } # Pre&Post empty function declaration, to be overriden from /lib/lsb/init-functions.d/* log_daemon_msg_pre () { :; } log_daemon_msg_post () { :; } log_begin_msg_pre () { :; } log_begin_msg_post () { :; } log_end_msg_pre () { :; } log_end_msg_post () { :; } log_action_msg_pre () { :; } log_action_msg_post () { :; } log_action_begin_msg_pre () { :; } log_action_begin_msg_post () { :; } log_action_end_msg_pre () { :; } log_action_end_msg_post () { :; } # Include hooks from other packages in /lib/lsb/init-functions.d for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null); do [ -r $hook ] && . $hook || true done +++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d ++ for hook in $(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null) ++ '[' -r /lib/lsb/init-functions.d/00-verbose ']' ++ . /lib/lsb/init-functions.d/00-verbose ## Generated automatically. Do not edit! -*- shell-script -*- vlog_daemon_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_daemon_msg "$@" fi } vlog_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_begin_msg "$@" fi } vlog_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_end_msg "$@" fi } vlog_action_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_msg "$@" fi } vlog_action_begin_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_begin_msg "$@" fi } vlog_action_end_msg() { if test x"${VERBOSE:-yes}" != x"no" ; then log_action_end_msg "$@" fi } # vim: ft=sh FANCYTTY= ++ FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true ++ '[' -e /etc/lsb-base-logging.sh ']' ++ true SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) +++ dirname /etc/init.d/mariadb ++ cd /etc/init.d ++ pwd -P ++ basename /etc/init.d/mariadb + SELF=/etc/init.d/mariadb MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + MYADMIN='/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf' # priority can be overridden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i" + ERR_LOGGER='logger -p daemon.err -t /etc/init.d/mariadb -i' if [ -f /etc/default/mysql ]; then . /etc/default/mysql fi + '[' -f /etc/default/mysql ']' # Also source default/mariadb in case the installation was upgraded from # packages originally installed from MariaDB.org repositories, which have # had support for reading /etc/default/mariadb since March 2016. if [ -f /etc/default/mariadb ]; then . /etc/default/mariadb fi + '[' -f /etc/default/mariadb ']' # Safeguard (relative paths, core dumps..) cd / + cd / umask 077 + umask 077 # mysqladmin likes to read /root/.my.cnf. This is usually not what I want # as many admins e.g. only store a password without a username there and # so break my scripts. export HOME=/etc/mysql/ + export HOME=/etc/mysql/ + HOME=/etc/mysql/ ## Fetch a particular option from mysql's invocation. # # Usage: void mariadbd_get_param option mariadbd_get_param() { /usr/sbin/mariadbd --print-defaults \ | tr " " "\n" \ | grep -- "--$1" \ | tail -n 1 \ | cut -d= -f2 } ## Do some sanity checks before even trying to start mariadbd. sanity_checks() { # check for config file if [ ! -r /etc/mysql/my.cnf ]; then log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER fi # check for diskspace shortage datadir=`mariadbd_get_param datadir` if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER exit 1 fi } ## Checks if there is a server running and if so if it is accessible. # # check_alive insists on a pingable server # check_dead also fails if there is a lost mariadbd in the process list # # Usage: boolean mariadbd_status [check_alive|check_dead] [warn|nowarn] mariadbd_status () { ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) ps_alive=0 pidfile=`mariadbd_get_param pid-file` if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi if [ "$1" = "check_alive" -a $ping_alive = 1 ] || [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then return 0 # EXIT_SUCCESS else if [ "$2" = "warn" ]; then echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug fi return 1 # EXIT_FAILURE fi } # # main() # case "${1:-''}" in 'start') sanity_checks; # Start daemon log_daemon_msg "Starting MariaDB database server" "mariadbd" if mariadbd_status check_alive nowarn; then log_progress_msg "already running" log_end_msg 0 else # Could be removed during boot test -e /run/mysqld || install -m 755 -o mysql -g root -d /run/mysqld # Start MariaDB! /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do sleep 1 if mariadbd_status check_alive nowarn ; then break; fi log_progress_msg "." done if mariadbd_status check_alive warn; then log_end_msg 0 # Now start mysqlcheck or whatever the admin wants. output=$(/etc/mysql/debian-start) if [ -n "$output" ]; then log_action_msg "$output" fi else log_end_msg 1 log_failure_msg "Please take a look at the syslog" fi fi ;; 'stop') # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible # at least for cron, we can rely on it here, too. (although we have # to specify it explicit as e.g. sudo environments points to the normal # users home and not /root) log_daemon_msg "Stopping MariaDB database server" "mariadbd" if ! mariadbd_status check_dead nowarn; then set +e shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? set -e if [ "$r" -ne 0 ]; then log_end_msg 1 [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" log_daemon_msg "Killing MariaDB database server by signal" "mariadbd" killall -15 mariadbd server_down= for i in `seq 1 600`; do sleep 1 if mariadbd_status check_dead nowarn; then server_down=1; break; fi done if test -z "$server_down"; then killall -9 mariadbd; fi fi fi if ! mariadbd_status check_dead warn; then log_end_msg 1 log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.5/README.Debian.gz!" exit -1 else log_end_msg 0 fi ;; 'restart') set +e; $SELF stop; set -e shift $SELF start "${@}" ;; 'reload'|'force-reload') log_daemon_msg "Reloading MariaDB database server" "mariadbd" $MYADMIN reload log_end_msg 0 ;; 'status') if mariadbd_status check_alive nowarn; then log_action_msg "$($MYADMIN version)" else log_action_msg "MariaDB is stopped." exit 3 fi ;; 'bootstrap') # Bootstrap the cluster, start the first node # that initiates the cluster log_daemon_msg "Bootstrapping the cluster" "mariadbd" $SELF start "${@:2}" --wsrep-new-cluster ;; *) echo "Usage: $SELF start|stop|restart|reload|force-reload|status" exit 1 ;; esac + case "${1:-''}" in + sanity_checks + '[' '!' -r /etc/mysql/my.cnf ']' ++ mariadbd_get_param datadir ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --datadir ++ tail -n 1 ++ cut -d= -f2 + datadir=/var/lib/mysql + LC_ALL=C + BLOCKSIZE= + df --portability /var/lib/mysql/. + tail -n 1 + awk '{ exit ($4>4096) }' + log_daemon_msg 'Starting MariaDB database server' mariadbd + '[' -z 'Starting MariaDB database server' ']' + log_daemon_msg_pre 'Starting MariaDB database server' mariadbd + : + '[' -z mariadbd ']' + echo -n 'Starting MariaDB database server: mariadbd' Starting MariaDB database server: mariadbd+ log_daemon_msg_post 'Starting MariaDB database server' mariadbd + : + mariadbd_status check_alive nowarn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='/usr/bin/mysqladmin: connect to server at '\''localhost'\'' failed error: '\''Can'\''t connect to local MySQL server through socket '\''/run/mysqld/mysqld.sock'\'' (2)'\'' Check that mysqld is running and that the socket: '\''/run/mysqld/mysqld.sock'\'' exists!' + ping_alive=0 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ grep -- --pid-file ++ tail -n 1 ++ tr ' ' '\n' ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' + '[' check_alive = check_alive -a 0 = 1 ']' + '[' check_alive = check_dead -a 0 = 0 -a 0 = 0 ']' + '[' nowarn = warn ']' + return 1 + test -e /run/mysqld + /usr/bin/mysqld_safe + logger -p daemon.err -t /etc/init.d/mariadb -i ++ seq 1 30 + for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}") + sleep 1 + mariadbd_status check_alive nowarn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='mysqld is alive' + ping_alive=1 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' ++ cat /run/mysqld/mysqld.pid + ps 5090 + ps_alive=1 + '[' check_alive = check_alive -a 1 = 1 ']' + return 0 + break + mariadbd_status check_alive warn ++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping + ping_output='mysqld is alive' + ping_alive=1 + ps_alive=0 ++ mariadbd_get_param pid-file ++ /usr/sbin/mariadbd --print-defaults ++ tr ' ' '\n' ++ grep -- --pid-file ++ tail -n 1 ++ cut -d= -f2 + pidfile=/run/mysqld/mysqld.pid + '[' -f /run/mysqld/mysqld.pid ']' ++ cat /run/mysqld/mysqld.pid + ps 5090 + ps_alive=1 + '[' check_alive = check_alive -a 1 = 1 ']' + return 0 + log_end_msg 0 + '[' -z 0 ']' + local retval + retval=0 + log_end_msg_pre 0 + : + log_use_fancy_output + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + '[' -t 1 ']' + '[' xxterm '!=' x ']' + '[' xxterm '!=' xdumb ']' + '[' -x /usr/bin/tput ']' + '[' -x /usr/bin/expr ']' + /usr/bin/tput hpa 60 + /usr/bin/tput setaf 1 + '[' -z ']' + FANCYTTY=1 + case "$FANCYTTY" in + true ++ /usr/bin/tput setaf 1 + RED='' ++ /usr/bin/tput setaf 3 + YELLOW='' ++ /usr/bin/tput op + NORMAL='' + '[' 0 -eq 0 ']' + echo . . + log_end_msg_post 0 + : + return 0 ++ /etc/mysql/debian-start + output= + '[' -n '' ']' db_stop # in case invoke failes + db_stop + echo STOP # dh_systemd_start doesn't emit anything since we still ship /etc/init.d/mariadb. # Thus MariaDB server is started via init.d script, which in turn redirects to # systemctl. If we upgrade from MySQL mysql.service may be masked, which also # means init.d script is disabled. Unmask mysql service explicitly. # Check first that the command exists, to avoid emitting any warning messages. if [ -x "$(command -v deb-systemd-helper)" ]; then deb-systemd-helper unmask mysql.service > /dev/null fi ++ command -v deb-systemd-helper + '[' -x /usr/bin/deb-systemd-helper ']' + deb-systemd-helper unmask mysql.service # Automatically added by dh_systemd_enable/13.2.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'mariadb.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'mariadb.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'mariadb.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'mariadb.service' >/dev/null || true fi fi + '[' triggered = configure ']' + '[' triggered = abort-upgrade ']' + '[' triggered = abort-deconfigure ']' + '[' triggered = abort-remove ']' # End automatically added section # Automatically added by dh_systemd_enable/13.2.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed 'mariadb.service'; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'mariadb.service' >/dev/null || true if deb-systemd-helper --quiet was-enabled 'mariadb.service'; then # Create new symlinks, if any. deb-systemd-helper enable 'mariadb.service' >/dev/null || true fi fi # Update the statefile to add new symlinks (if any), which need to be cleaned # up on purge. Also remove old symlinks. deb-systemd-helper update-state 'mariadb.service' >/dev/null || true fi + '[' triggered = configure ']' + '[' triggered = abort-upgrade ']' + '[' triggered = abort-deconfigure ']' + '[' triggered = abort-remove ']' # End automatically added section # Automatically added by dh_installinit/13.2.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "/etc/init.d/mariadb" ]; then update-rc.d mariadb defaults 19 21 >/dev/null || exit 1 fi fi + '[' triggered = configure ']' + '[' triggered = abort-upgrade ']' + '[' triggered = abort-deconfigure ']' + '[' triggered = abort-remove ']' # End automatically added section # Modified dh_systemd_start snippet that's not added automatically if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true deb-systemd-invoke start mariadb.service >/dev/null || true # Modified dh_installinit snippet to only run with sysvinit elif [ -x "/etc/init.d/mariadb" ]; then if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then invoke-rc.d mariadb start || exit $? fi fi + '[' -d /run/systemd/system ']' + '[' -x /etc/init.d/mariadb ']' + '[' triggered = configure ']' + '[' triggered = abort-upgrade ']' root@95f18ae10f8e:/build#