1

Topic: Installation wipes debian-sys-maint user

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Not related
- Manage mail accounts with iRedAdmin-Pro? Not related
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

It seems that when installing the server, the mysql database would be completely wiped including existing users, thus debian-sys-maint user would gone with it. However, various package-provided scripts like init.d and logrotate scripts rely on this account through mysqladmin tool.

For example, "/etc/init.d/mysql reload" actually calls "mysqladmin reload" and /etc/logrotate.d/mysql-server needs to flush the logs by calling "mysqladmin flush-error-log ..." through debian-sys-maint user.

Server admins would need to manually recreate this user to make sure those scripts still works reliably.

You should consider preserving this account when installing iRedMail server using mysql / mariadb backend on debian and ubuntu servers. Related credentials resides in /etc/mysql/debian.cnf by default and only readable by root, so you should be able to use it.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Installation wipes debian-sys-maint user

Additional info below.

From README.Debian of mysql-server-5.7 package distributed by Ubuntu:

* MYSQL WON'T START OR STOP?:
=============================
You may never ever delete the special mysql user "debian-sys-maint". This
user together with the credentials in /etc/mysql/debian.cnf are used by the
init scripts to stop the server as they would require knowledge of the mysql
root users password else.
So in most of the times you can fix the situation by making sure that the
debian.cnf file contains the right password, e.g. by setting a new one
(remember to do a "flush privileges" then).

From /etc/init.d/mysql script of the same package:

...
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
...
mysqld_status () {
    ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
...
  'stop')
...
    log_daemon_msg "Stopping MySQL database server" "mysqld"
    if ! mysqld_status check_dead nowarn; then
      set +e
      shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
      set -e
...

While it could stop the server by sending TERM to mysqld, you should be able to see that mysqladmin tool and debian-sys-maint user is being used.

MariaDB packages claims that it does not use this user anymore, but in my installation debian.cnf does contain it's credentials.

3

Re: Installation wipes debian-sys-maint user

iRedMail doesn't remove this sql user at all. i'm not sure why it happened on your server. sad