treewide: fix service status command in procd compatible services

Fix breaking change introduced in the main tree with a commit
7519a36774ca ("base-files,procd: add generic service status") where the
old service `status` callback function doesn't work anymore and needs to
be renamed to `status_service`.  This name was chosen for consistency
with start and stop function callbacks, which are using `start_service`
and `stop_service` naming schemes.

While at it, fix whitespace issues in the status_service as well.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-September/019035.html
Reported-by: Dirk Brenken <dev@brenken.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
Petr Štetiar
2019-09-21 10:53:48 +02:00
parent df4811c6c3
commit 8383c19b90
8 changed files with 9 additions and 12 deletions

View File

@@ -6,9 +6,6 @@ PROG=/usr/bin/postmaster
USE_PROCD=1
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Show current status of the PostgreSQL server"
fix_hosts() {
# make sure localhost (without a dot) is in /etc/hosts
grep -q 'localhost$' /etc/hosts || echo '127.0.0.1 localhost' >> /etc/hosts
@@ -71,7 +68,7 @@ stop_service() {
/usr/bin/pg_ctl stop -U postgres -D "${pgdata}" -s
}
status() {
status_service() {
config_load "postgresql"
config_get pgdata config PGDATA
/usr/bin/pg_ctl status -U postgres -D "${pgdata}"