Skip to content

Commit 4e0c670

Browse files
authored
Merge pull request hestiacp#2390 from buxjr311/patch-3
Update v-list-sys-services
2 parents 07d3763 + ada5eb2 commit 4e0c670

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

bin/v-list-sys-services

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,24 @@ if [ -n "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then
230230
service="$db"
231231
proc_name=''
232232
if [ "$service" = 'mysql' ]; then
233-
if [ -d "/etc/sysconfig" ]; then
233+
mysql_version=$(mysql -V)
234+
mariadb_string="MariaDB"
235+
if [[ ! $mysql_version =~ $mariadb_string ]]; then
236+
# MySQL
234237
service='mysqld'
235238
proc_name='mysqld'
236-
fi
237-
if [ -e "/lib/systemd/system/mariadb.service" ]; then
238-
service='mariadb'
239-
proc_name='mysqld'
240-
fi
241-
if [ -f /usr/bin/mysql ]; then
242-
mariadb_v=`mysql -V | awk 'NR==1{print $5}' | head -c 4`
243-
if [ $mariadb_v = "10.5" ] || [ $mariadb_v = "10.6" ]; then
239+
else
240+
# MariaDB
241+
if [ -e "/lib/systemd/system/mariadb.service" ]; then
244242
service='mariadb'
245-
proc_name='mariadbd'
243+
proc_name='mysqld'
244+
fi
245+
if [ -f /usr/bin/mysql ]; then
246+
mariadb_v=`mysql -V | awk 'NR==1{print $5}' | head -c 4`
247+
if [ $mariadb_v = "10.5" ] || [ $mariadb_v = "10.6" ]; then
248+
service='mariadb'
249+
proc_name='mariadbd'
250+
fi
246251
fi
247252
fi
248253
fi

0 commit comments

Comments
 (0)