Browse Source

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>
lilik-openwrt-22.03
Petr Štetiar 5 years ago
parent
commit
8383c19b90
8 changed files with 9 additions and 12 deletions
  1. +1
    -1
      libs/postgresql/Makefile
  2. +1
    -4
      libs/postgresql/files/postgresql.init
  3. +1
    -1
      net/apfree-wifidog/Makefile
  4. +1
    -1
      net/apfree-wifidog/files/wifidogx.init
  5. +1
    -1
      net/simple-adblock/Makefile
  6. +2
    -2
      net/simple-adblock/files/simple-adblock.init
  7. +1
    -1
      net/wifidog/Makefile
  8. +1
    -1
      net/wifidog/files/wifidog.init

+ 1
- 1
libs/postgresql/Makefile View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=postgresql PKG_NAME:=postgresql
PKG_VERSION:=11.3 PKG_VERSION:=11.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org> PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=PostgreSQL PKG_LICENSE:=PostgreSQL
PKG_CPE_ID:=cpe:/a:postgresql:postgresql PKG_CPE_ID:=cpe:/a:postgresql:postgresql


+ 1
- 4
libs/postgresql/files/postgresql.init View File

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


+ 1
- 1
net/apfree-wifidog/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=apfree-wifidog PKG_NAME:=apfree-wifidog
PKG_VERSION:=3.11.1716 PKG_VERSION:=3.11.1716
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/liudf0716/apfree_wifidog.git PKG_SOURCE_URL:=https://github.com/liudf0716/apfree_wifidog.git


+ 1
- 1
net/apfree-wifidog/files/wifidogx.init View File

@ -280,6 +280,6 @@ start_service() {
procd_close_instance procd_close_instance
} }
status() {
status_service() {
/usr/bin/wdctlx status /usr/bin/wdctlx status
} }

+ 1
- 1
net/simple-adblock/Makefile View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=simple-adblock PKG_NAME:=simple-adblock
PKG_VERSION:=1.8.2 PKG_VERSION:=1.8.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net> PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later


+ 2
- 2
net/simple-adblock/files/simple-adblock.init View File

@ -1028,9 +1028,9 @@ killcache() {
return 0 return 0
} }
status() {
status_service() {
local status="$(tmpfs get status)" error="$(tmpfs get error)" message="$(tmpfs get message)" local status="$(tmpfs get status)" error="$(tmpfs get error)" message="$(tmpfs get message)"
if [ -n "$status" ] && [ -n "$message" ]; then
if [ -n "$status" ] && [ -n "$message" ]; then
status="${status}: $message" status="${status}: $message"
fi fi
[ -n "$status" ] && output "$serviceName $status\\n" [ -n "$status" ] && output "$serviceName $status\\n"


+ 1
- 1
net/wifidog/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=wifidog PKG_NAME:=wifidog
PKG_VERSION:=1.3.0 PKG_VERSION:=1.3.0
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/wifidog/wifidog-gateway PKG_SOURCE_URL:=https://github.com/wifidog/wifidog-gateway


+ 1
- 1
net/wifidog/files/wifidog.init View File

@ -17,6 +17,6 @@ start_service() {
procd_close_instance procd_close_instance
} }
status() {
status_service() {
/usr/bin/wdctl status /usr/bin/wdctl status
} }

Loading…
Cancel
Save