Skip to content

Commit 8a10a6c

Browse files
committed
fix for postgresql database status
1 parent b30cf73 commit 8a10a6c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

bin/v-list-sys-services

+15-3
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,22 @@ service=$DB_SYSTEM
147147
if [ ! -z "$service" ] && [ "$service" != 'no' ]; then
148148
for db in ${DB_SYSTEM//,/ }; do
149149
service="$db"
150-
if [ "$service" == 'mysql' ] && [ ! -e "/etc/init.d/$service" ]; then
151-
service='mysqld'
150+
if [ "$service" == 'mysql' ]; then
151+
if [ ! -e "/etc/init.d/$service" ]; then
152+
service='mysqld'
153+
fi
154+
if [ ! -e "/etc/redhat-release" ]; then
155+
db_proc_name='mysqld'
156+
fi
152157
fi
153-
get_srv_state $service
158+
if [ "$service" == 'pgsql' ]; then
159+
service='postgresql'
160+
db_proc_name='postmaster'
161+
if [ ! -e "/etc/redhat-release" ]; then
162+
db_proc_name='postgres'
163+
fi
164+
fi
165+
get_srv_state $service $db_proc_name
154166
str="$str\nNAME='$service' SYSTEM='database server' STATE='$state'"
155167
str="$str CPU='$cpu' MEM='$mem' RTIME='$rtime'"
156168
done

0 commit comments

Comments
 (0)