Skip to content

Instantly share code, notes, and snippets.

@msimerson
Last active May 18, 2023 07:12
Show Gist options
  • Save msimerson/2ea2e5a986bb7f9e5b97 to your computer and use it in GitHub Desktop.
Save msimerson/2ea2e5a986bb7f9e5b97 to your computer and use it in GitHub Desktop.
Mail Toaster 6 - sample output - provision-mysql.sh
[~/mt6]# provision mysql
172.16.15.4
*** skipping fetch, running from git ***
v: 20230507
loading mail-toaster.conf
mysql enabled
toaster host: freebsd.vmware.imac27.simerson.net
email domain: imac27.simerson.net
IPv6 jail network: fd7a:e5cd:1fc1:186f:dead:beef:cafe
shell: /usr/local/bin/bash
safe name: stage
*** installing MySQL ***
zroot/jails/base-13.2-RELEASE@p0 snapshot exists
*** stage cleanup ***
service jail stop stage
Stopping jails:.
jail -r stage
*** stage jail filesystem setup ***
zfs clone zroot/jails/base-13.2-RELEASE@p0 zroot/jails/stage
sysrc -R /jails/stage hostname=mysql
hostname: base -> mysql
zroot/data/mysql
*** zroot/data filesystem exists ***
*** zfs create -o mountpoint=/data/mysql zroot/data/mysql ***
done
*** zroot/data/mysql filesystem exists ***
mkdir -p /jails/stage/var/db/mysql
mount_nullfs /data/mysql /jails/stage/var/db/mysql
mount /jails/stage/usr/ports
mount /jails/stage/var/cache/pkg
*** stage jail mysql startup ***
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg
32-bit compatibility ldconfig path: /usr/lib32
Setting hostname: mysql.
Clearing /tmp (X related).
Updating /var/run/os-release done.
Starting syslogd.
Starting cron.
Thu May 18 00:03:55 PDT 2023
*** enabling bsd_cache ***
nameserver 172.16.15.3
nameserver fd7a:e5cd:1fc1:186f:dead:beef:cafe:0003
*** updating /jails/stage/usr/local/etc/pkg/repos/FreeBSD.conf ***
FreeBSD: {
enabled: no
}
*** updating /jails/stage/usr/local/etc/pkg/repos/MT6.conf ***
MT6: {
url: "http://pkg/${ABI}/latest",
enabled: yes
}
*** updating pkg database ***
Updating MT6 repository catalogue...
[mysql] Fetching meta.conf: 100% 163 B 0.2kB/s 00:01
[mysql] Fetching packagesite.pkg: 100% 7 MiB 3.5MB/s 00:02
Processing entries: 100%
MT6 repository update completed. 33157 packages processed.
All repositories are up to date.
*** installing mysql ***
pkg -j stage install -y mysql80-server
Updating MT6 repository catalogue...
MT6 repository is up to date.
All repositories are up to date.
The following 26 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
curl: 8.0.1
cyrus-sasl: 2.1.28
groff: 1.22.4_4
hidapi: 0.13.1
icu: 73.1,1
libcbor: 0.10.2
libcjson: 1.7.15_1
libedit: 3.1.20221030,1
libevent: 2.1.12
libfido2: 1.13.0
libiconv: 1.17
libidn2: 2.3.4
liblz4: 1.9.4,1
libnghttp2: 1.52.0
libpaper: 1.1.28
libpsl: 0.21.2_3
libssh2: 1.10.0_1,3
libunistring: 1.1
libunwind: 20211201_2
mysql80-client: 8.0.32_2
mysql80-server: 8.0.32_3
openldap26-client: 2.6.4
perl5: 5.32.1_3
psutils: 1.17_5
uchardet: 0.0.8
zstd: 1.5.4_2
Number of packages to be installed: 26
The process will require 466 MiB more space.
57 MiB to be downloaded.
[mysql] [1/24] Fetching cyrus-sasl-2.1.28.pkg: 100% 966 KiB 989.7kB/s 00:01
[mysql] [2/24] Fetching libcjson-1.7.15_1.pkg: 100% 35 KiB 35.7kB/s 00:01
[mysql] [3/24] Fetching libedit-3.1.20221030,1.pkg: 100% 140 KiB 143.4kB/s 00:01
[mysql] [4/24] Fetching icu-73.1,1.pkg: 100% 11 MiB 3.9MB/s 00:03
[mysql] [5/24] Fetching libidn2-2.3.4.pkg: 100% 134 KiB 136.7kB/s 00:01
[mysql] [6/24] Fetching psutils-1.17_5.pkg: 100% 59 KiB 59.9kB/s 00:01
[mysql] [7/24] Fetching openldap26-client-2.6.4.pkg: 100% 1 MiB 1.1MB/s 00:01
[mysql] [8/24] Fetching groff-1.22.4_4.pkg: 100% 3 MiB 2.9MB/s 00:01
[mysql] [9/24] Fetching libpaper-1.1.28.pkg: 100% 24 KiB 24.4kB/s 00:01
[mysql] [10/24] Fetching liblz4-1.9.4,1.pkg: 100% 145 KiB 148.0kB/s 00:01
[mysql] [11/24] Fetching hidapi-0.13.1.pkg: 100% 34 KiB 34.5kB/s 00:01
[mysql] [12/24] Fetching perl5-5.32.1_3.pkg: 100% 14 MiB 3.0MB/s 00:05
[mysql] [13/24] Fetching mysql80-server-8.0.32_3.pkg: 100% 19 MiB 2.0MB/s 00:10
[mysql] [14/24] Fetching libunwind-20211201_2.pkg: 100% 127 KiB 130.1kB/s 00:01
[mysql] [15/24] Fetching zstd-1.5.4_2.pkg: 100% 538 KiB 551.3kB/s 00:01
[mysql] [16/24] Fetching libunistring-1.1.pkg: 100% 554 KiB 567.2kB/s 00:01
[mysql] [17/24] Fetching libssh2-1.10.0_1,3.pkg: 100% 249 KiB 254.5kB/s 00:01
[mysql] [18/24] Fetching libpsl-0.21.2_3.pkg: 100% 61 KiB 62.9kB/s 00:01
[mysql] [19/24] Fetching curl-8.0.1.pkg: 100% 1 MiB 1.5MB/s 00:01
[mysql] [20/24] Fetching mysql80-client-8.0.32_2.pkg: 100% 3 MiB 3.6MB/s 00:01
[mysql] [21/24] Fetching libiconv-1.17.pkg: 100% 617 KiB 632.3kB/s 00:01
[mysql] [22/24] Fetching libfido2-1.13.0.pkg: 100% 234 KiB 240.1kB/s 00:01
[mysql] [23/24] Fetching libcbor-0.10.2.pkg: 100% 32 KiB 32.4kB/s 00:01
[mysql] [24/24] Fetching uchardet-0.0.8.pkg: 100% 112 KiB 114.4kB/s 00:01
Checking integrity... done (0 conflicting)
[mysql] [1/26] Installing libunistring-1.1...
[mysql] [1/26] Extracting libunistring-1.1: 100%
[mysql] [2/26] Installing libcjson-1.7.15_1...
[mysql] [2/26] Extracting libcjson-1.7.15_1: 100%
[mysql] [3/26] Installing libidn2-2.3.4...
[mysql] [3/26] Extracting libidn2-2.3.4: 100%
[mysql] [4/26] Installing libpaper-1.1.28...
[mysql] [4/26] Extracting libpaper-1.1.28: 100%
[mysql] [5/26] Installing cyrus-sasl-2.1.28...
*** Added group `cyrus' (id 60)
*** Added user `cyrus' (id 60)
[mysql] [5/26] Extracting cyrus-sasl-2.1.28: 100%
[mysql] [6/26] Installing libnghttp2-1.52.0...
[mysql] [6/26] Extracting libnghttp2-1.52.0: 100%
[mysql] [7/26] Installing psutils-1.17_5...
[mysql] [7/26] Extracting psutils-1.17_5: 100%
[mysql] [8/26] Installing liblz4-1.9.4,1...
[mysql] [8/26] Extracting liblz4-1.9.4,1: 100%
[mysql] [9/26] Installing perl5-5.32.1_3...
[mysql] [9/26] Extracting perl5-5.32.1_3: 100%
[mysql] [10/26] Installing libssh2-1.10.0_1,3...
[mysql] [10/26] Extracting libssh2-1.10.0_1,3: 100%
[mysql] [11/26] Installing libpsl-0.21.2_3...
[mysql] [11/26] Extracting libpsl-0.21.2_3: 100%
[mysql] [12/26] Installing libiconv-1.17...
[mysql] [12/26] Extracting libiconv-1.17: 100%
[mysql] [13/26] Installing libcbor-0.10.2...
[mysql] [13/26] Extracting libcbor-0.10.2: 100%
[mysql] [14/26] Installing uchardet-0.0.8...
[mysql] [14/26] Extracting uchardet-0.0.8: 100%
[mysql] [15/26] Installing libedit-3.1.20221030,1...
[mysql] [15/26] Extracting libedit-3.1.20221030,1: 100%
[mysql] [16/26] Installing icu-73.1,1...
[mysql] [16/26] Extracting icu-73.1,1: 100%
[mysql] [17/26] Installing openldap26-client-2.6.4...
[mysql] [17/26] Extracting openldap26-client-2.6.4: 100%
[mysql] [18/26] Installing groff-1.22.4_4...
[mysql] [18/26] Extracting groff-1.22.4_4: 100%
[mysql] [19/26] Installing hidapi-0.13.1...
[mysql] [19/26] Extracting hidapi-0.13.1: 100%
[mysql] [20/26] Installing libunwind-20211201_2...
[mysql] [20/26] Extracting libunwind-20211201_2: 100%
[mysql] [21/26] Installing zstd-1.5.4_2...
[mysql] [21/26] Extracting zstd-1.5.4_2: 100%
[mysql] [22/26] Installing curl-8.0.1...
[mysql] [22/26] Extracting curl-8.0.1: 100%
[mysql] [23/26] Installing libfido2-1.13.0...
[mysql] [23/26] Extracting libfido2-1.13.0: 100%
[mysql] [24/26] Installing libevent-2.1.12...
[mysql] [24/26] Extracting libevent-2.1.12: 100%
[mysql] [25/26] Installing mysql80-client-8.0.32_2...
[mysql] [25/26] Extracting mysql80-client-8.0.32_2: 100%
[mysql] [26/26] Installing mysql80-server-8.0.32_3...
===> Creating groups.
Creating group 'mysql' with gid '88'.
===> Creating users
Creating user 'mysql' with uid '88'.
===> Creating homedir(s)
[mysql] [26/26] Extracting mysql80-server-8.0.32_3: 100%
=====
Message from cyrus-sasl-2.1.28:
--
You can use sasldb2 for authentication, to add users use:
saslpasswd2 -c username
If you want to enable SMTP AUTH with the system Sendmail, read
Sendmail.README
NOTE: This port has been compiled with a default pwcheck_method of
auxprop. If you want to authenticate your user by /etc/passwd,
PAM or LDAP, install ports/security/cyrus-sasl2-saslauthd and
set sasl_pwcheck_method to saslauthd after installing the
Cyrus-IMAPd 2.X port. You should also check the
/usr/local/lib/sasl2/*.conf files for the correct
pwcheck_method.
If you want to use GSSAPI mechanism, install
ports/security/cyrus-sasl2-gssapi.
If you want to use SRP mechanism, install
ports/security/cyrus-sasl2-srp.
If you want to use LDAP auxprop plugin, install
ports/security/cyrus-sasl2-ldapdb.
=====
Message from openldap26-client-2.6.4:
--
The OpenLDAP client package has been successfully installed.
Edit
/usr/local/etc/openldap/ldap.conf
to change the system-wide client defaults.
Try `man ldap.conf' and visit the OpenLDAP FAQ-O-Matic at
http://www.OpenLDAP.org/faq/index.cgi?file=3
for more information.
=====
Message from groff-1.22.4_4:
--
In order to be able to use the html driver, you need to install the following
packages:
- ghostscript
- netpbm
=====
Message from mysql80-client-8.0.32_2:
--
This is the mysql CLIENT without the server.
for complete server and client, please install databases/mysql80-server
=====
Message from mysql80-server-8.0.32_3:
--
There is no initial password for first time use of MySQL.
Keep in mind to reset it to a secure password.
MySQL80 has a default /usr/local/etc/mysql/my.cnf,
remember to replace it with your own
or set `mysql_optfile="$YOUR_CNF_FILE` in rc.conf.
*** starting mysql ***
sysrc -R /jails/stage mysql_enable=YES
mysql_enable: -> YES
jexec stage service mysql-server start
Starting mysql.
*** configuring mysql ***
sysrc -R /jails/stage mysql_optfile=/var/db/mysql/my.cnf
mysql_optfile: -> /var/db/mysql/my.cnf
*** installing /data/mysql/my.cnf ***
[mysqld]
innodb_doublewrite = off
innodb_file_per_table = 1
*** TOASTER_MYSQL_PASS unset in mail-toaster.conf, generating a password ***
jexec stage mysql --password=FddjBPIZDRC9vPdLKDz2
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
jexec stage mysql -u root
[client]
user = root
password = FddjBPIZDRC9vPdLKDz2
*** testing mysql ***
checking for port 3306 listener in staged jail
checking port 3306
Success! Port 3306 is listening in staging jail
jexec stage mysql --password=FddjBPIZDRC9vPdLKDz2
mysql: [Warning] Using a password on the command line interface can be insecure.
Database
information_schema
mysql
performance_schema
sys
it worked
*** promoting jail mysql ***
service jail stop stage
Stopping jails: stage.
jail -r stage
*** configuring DNS for local recursor ***
unmount /jails/stage/usr/ports
unmount /jails/stage/var/cache/pkg
*** zroot/data/mysql filesystem exists ***
/data/mysql on /jails/stage/var/db/mysql (nullfs, local, noatime, nfsv4acls)
unmount data fs /jails/stage/var/db/mysql
clearing pkg cache
clearing freebsd-update cache
zfs rename zroot/jails/stage zroot/jails/mysql.ready
cannot unmount '/jails/stage': pool or dataset is busy
waiting for ZFS filesystem to quiet (0)
cannot unmount '/jails/stage': pool or dataset is busy
waiting for ZFS filesystem to quiet (1)
cannot unmount '/jails/stage': pool or dataset is busy
waiting for ZFS filesystem to quiet (2)
cannot unmount '/jails/stage': pool or dataset is busy
waiting for ZFS filesystem to quiet (3)
cannot unmount '/jails/stage': pool or dataset is busy
waiting for ZFS filesystem to quiet (4)
cannot unmount '/jails/stage': pool or dataset is busy
waiting for ZFS filesystem to quiet (5)
service jail stop mysql
Stopping jails:/etc/rc.d/jail: WARNING: Invalid configuration for mysql (no jail.conf, no hostname, or no path). Jail mysql was ignored.
.
jail -r mysql
*** zroot/data/mysql filesystem exists ***
zfs rename zroot/jails/mysql.ready zroot/jails/mysql
*** creating /etc/jail.conf.d/mysql.conf ***
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.clean;
mount.devfs;
devfs_ruleset=5;
path = "/jails/$name";
interface = lo1;
host.hostname = $name;
mysql {
ip4.addr = lo1|172.16.15.4;
ip6.addr = lo1|fd7a:e5cd:1fc1:186f:dead:beef:cafe:0004;
mount += "/data/mysql $path/var/db/mysql nullfs rw 0 0";
}
*** service jail start mysql ***
Starting jails: mysql.
*** enabling jail mysql at startup ***
jail_list: dns bsd_cache -> dns bsd_cache mysql
security_status_pkgaudit_jails: dns bsd_cache -> dns bsd_cache mysql
Success! A new 'mysql' jail is provisioned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment