From 687100d88857458c030894031b9534ba02185315 Mon Sep 17 00:00:00 2001 From: libvoid <135131094+libvoid@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:49:45 +0200 Subject: [PATCH] make sure mariadb is started and enabled --- packaging/postinstall.sh | 1 - packaging/preinstall.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/postinstall.sh b/packaging/postinstall.sh index 928dc2673..897b53523 100755 --- a/packaging/postinstall.sh +++ b/packaging/postinstall.sh @@ -3,7 +3,6 @@ mkdir -p /etc/systemd/system/sshportal.service.d/ if [ -f /tmp/sshportal_mariadb ]; then - systemctl enable --now mariadb SOCKET="$(mysqladmin variables | grep ".sock " | awk '{print $4}')" readonly SOCKET diff --git a/packaging/preinstall.sh b/packaging/preinstall.sh index fa86e28b3..f86840311 100755 --- a/packaging/preinstall.sh +++ b/packaging/preinstall.sh @@ -31,6 +31,7 @@ if [ "$RET" = "true" ] || [ "$SSHPORTAL_MARIADB_SETUP" = "true" ]; then fi useradd -rd /nonexistent -s /usr/sbin/nologin sshportal # can't use systemd dynamic user to access the unix socket + systemctl enable --now mariadb mariadb -e "CREATE DATABASE sshportal CHARACTER SET utf8;" || printf "${BYELLOW}%s %s${NC}\n" "WARNING: sshportal database already exists" mariadb -e "GRANT ALL on sshportal.* to 'sshportal'@'localhost' identified via unix_socket;"