Skip to content

Commit

Permalink
make sure mariadb is started and enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
libvoid committed Sep 1, 2023
1 parent 2288a7d commit 687100d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion packaging/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions packaging/preinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;"

Expand Down

0 comments on commit 687100d

Please sign in to comment.