Skip to content

Commit fc1e670

Browse files
author
Alexandros Ioannides
authored
Better detection for MySQL / MariaDB Service
1 parent 0464ca5 commit fc1e670

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

bin/v-list-sys-services

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,22 @@ fi
221221
# Checking DB system
222222
if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then
223223
for db in ${DB_SYSTEM//,/ }; do
224-
proc_name=''
225224
service="$db"
225+
proc_name=''
226226
if [ "$service" = 'mysql' ]; then
227-
if [ -d "/etc/sysconfig" ]; then
228-
service='mysqld'
227+
if [ -e "/lib/systemd/system/mariadb.service" ]; then
228+
service='mariadb'
229229
proc_name='mysqld'
230230
fi
231-
if [ -e "/usr/lib/systemd/system/mariadb.service" ]; then
232-
service='mariadb'
231+
if [ -f /usr/bin/mysqladmin ]; then
232+
mariadb_v=`mysqladmin --version | awk 'NR==1{print $5}' | head -c 4`
233+
if [ $mariadb_v = "10.5" ]; then
234+
service='mariadb'
235+
proc_name='mariadbd'
236+
fi
237+
fi
238+
if [ -d "/etc/sysconfig" ]; then
239+
service='mysqld'
233240
proc_name='mysqld'
234241
fi
235242
fi

0 commit comments

Comments
 (0)