I'm using OpenVZ7. So, when restart the MariaDB server with above trick, it fails to restart the MariaDB server.
# systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
# systemctl -l status mariadb
● mariadb.service - MariaDB 10.2.30 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─dontprotecthome.conf, limitnofile.conf, migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since Dom 2020-01-05 19:10:02 -03; 2s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 3081 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=201/NICE)
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: Starting MariaDB 10.2.30 database server...
Jan 05 19:10:02 painel.edeaas.com.br systemd[3081]: Failed at step NICE spawning /bin/sh: Permission denied
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: mariadb.service: control process exited, code=exited status=201
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: Failed to start MariaDB 10.2.30 database server.
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: Unit mariadb.service entered failed state.
Jan 05 19:10:02 painel.edeaas.com.br systemd[1]: mariadb.service failed.
Running "systemctl disable mysql" didn't solved the problem.
When upgraded MariaDB, I see was created a file "/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf":
# converted using /usr/bin/mariadb-service-convert
#
[Service]
Nice=-5
For some reason, I cannot do nice/renice of processes priorities in OpenVZ7, although being root user.
I searched google, but could't find anything to solve this problem.
So, commenting the "Nice" parameter, and solved the problem.
# converted using /usr/bin/mariadb-service-convert
#
#[Service]
#Nice=-5
# systemctl -l status mariadb
● mariadb.service - MariaDB 10.2.30 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Dom 2020-01-05 20:16:38 -03; 2h 51min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 9559 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 9441 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 9440 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 9527 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─9527 /usr/sbin/mysqld --basedir=/usr
I tried too to add "DefaultLimitNICE:-5:-5" to /etc/systemd/system.conf, but the problem persists.
But strangely, I can use "renice" the running processes by changing the process priority with "htop" tool (need to install it).
Seems a problem with sh/bash.
Regards,
Netino