mariadb service is controlled by systemd
Do not install SysV init script on Debian/Ubuntu in /etc/init.d/
put it in /usr/share/mysql in case the user would need it for something.
Use systemctl in pre/post scripts directly
without funky conditionals and wrapper scripts
Debian part. Do not ask to set a root password,
do not create debian-sys-maint user (but preserve an existing one
on upgrades - user scripts might be relying on it).
Just create an empty /etc/mysql/debian.cnf for --defaults-file not to fail