From e51a1d6fc0c105d56c6f05efb3d9fd05b7e4f22f Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Tue, 3 Jan 2023 10:48:57 +1100 Subject: MDEV-30329: mariadb-service-convert resets systemd service to default User=root If mariadb-service-convert is run and the user variable is unset then this sets `User=` in `[Service]`, which then tries to run mariadb as root, which in-turn fails. This only happens when mysqld_safe is missing which is all the time now. So don't set `User=` if there is no user variable. Reviewer: Sergei Golubchik (in PR #2382) --- scripts/mariadb-service-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mariadb-service-convert b/scripts/mariadb-service-convert index 38043733554..ade07e9a336 100755 --- a/scripts/mariadb-service-convert +++ b/scripts/mariadb-service-convert @@ -36,7 +36,7 @@ echo '[Service]' echo -if [[ ( "$user" != "root" && "$user" != "mysql" ) || "${SET_USER}" == 1 ]]; then +if [[ ( ! -z "$user" && "$user" != "root" && "$user" != "mysql" ) || "${SET_USER}" == 1 ]]; then echo User=$user fi -- cgit v1.2.1