From 07d909875407196938b193ef3ed44dcddb5a20c4 Mon Sep 17 00:00:00 2001 From: viktorxda <35473052+viktorxda@users.noreply.github.com> Date: Sun, 4 Feb 2024 21:20:04 +0100 Subject: [PATCH] [no ci] Package: update webui makefile (#1296) --- general/package/majestic/files/S95majestic | 36 ++++++------------- general/package/webui/Config.in | 4 +-- .../package/webui/files/{ => etc}/httpd.conf | 0 .../package/webui/files/{ => init.d}/S50httpd | 13 +++---- general/package/webui/webui.mk | 5 ++- 5 files changed, 21 insertions(+), 37 deletions(-) rename general/package/webui/files/{ => etc}/httpd.conf (100%) rename general/package/webui/files/{ => init.d}/S50httpd (92%) diff --git a/general/package/majestic/files/S95majestic b/general/package/majestic/files/S95majestic index aaf96fdb..736480db 100755 --- a/general/package/majestic/files/S95majestic +++ b/general/package/majestic/files/S95majestic @@ -1,31 +1,21 @@ #!/bin/sh DAEMON="majestic" -DAEMON_PATH="/usr/bin" PIDFILE="/var/run/$DAEMON.pid" - DAEMON_ARGS="-s" -# shellcheck source=/dev/null [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" load_majestic() { printf 'Starting %s: ' "$DAEMON" [ -f $DAEMON_PATH/$DAEMON ] || echo -en "DISABLED, " - # shellcheck disable=SC2086 # we need the word splitting + [ -f /etc/coredump.conf ] && . /etc/coredump.conf if [ "$coredump_enabled" ]; then - [ "$(cli -g .watchdog.timeout)" -lt "30" ] && cli -s .watchdog.timeout 30 ulimit -c unlimited && echo "|/usr/sbin/sendcoredump.sh" >/proc/sys/kernel/core_pattern fi - if [ "ingenic" = "$(ipcinfo -v)" ] && [ -f /etc/webui/imp.conf ]; then - start-stop-daemon -b -m -S -q -p "$PIDFILE" -x /usr/bin/env -- \ - LD_PRELOAD=/usr/lib/libimp_control.so $DAEMON_PATH/$DAEMON $DAEMON_ARGS - else - start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON_PATH/$DAEMON" -- $DAEMON_ARGS - fi - + start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" -- $DAEMON_ARGS status=$? if [ "$status" -eq 0 ]; then echo "OK" @@ -35,7 +25,6 @@ load_majestic() { return "$status" } -# The daemon does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one. start() { logger -s -p daemon.info -t $(ipcinfo -v) "Loading video system has started..." export SENSOR=$(fw_printenv -n sensor) @@ -56,21 +45,18 @@ stop() { return "$status" } -restart() { - stop || true - sleep 1 - reload -} - -reload() { - load_majestic -} - case "$1" in - start|stop|restart|reload) + start|stop) "$1" ;; + + restart) + stop + load_majestic + ;; + *) - echo "Usage: $0 {start|stop|restart|reload}" + echo "Usage: $0 {start|stop|restart}" exit 1 + ;; esac diff --git a/general/package/webui/Config.in b/general/package/webui/Config.in index 9724e8fe..12cea0f1 100644 --- a/general/package/webui/Config.in +++ b/general/package/webui/Config.in @@ -2,7 +2,5 @@ config BR2_PACKAGE_WEBUI bool "webui" select BR2_PACKAGE_HASERL help - The simplest web interface constructor based on - httpd and haserl. - + Simple web interface based on httpd and haserl. https://openipc.org diff --git a/general/package/webui/files/httpd.conf b/general/package/webui/files/etc/httpd.conf similarity index 100% rename from general/package/webui/files/httpd.conf rename to general/package/webui/files/etc/httpd.conf diff --git a/general/package/webui/files/S50httpd b/general/package/webui/files/init.d/S50httpd similarity index 92% rename from general/package/webui/files/S50httpd rename to general/package/webui/files/init.d/S50httpd index 3283e8cd..5f71f932 100755 --- a/general/package/webui/files/S50httpd +++ b/general/package/webui/files/init.d/S50httpd @@ -3,7 +3,6 @@ DAEMON="httpd" PIDFILE="/var/run/$DAEMON.pid" CONFFILE="/etc/httpd.conf" - HTTPD_ARGS="httpd -p 85 -f -c $CONFFILE -r Authentication" # shellcheck source=/dev/null @@ -23,8 +22,7 @@ start() { printf 'Starting %s: ' "$DAEMON" [ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, " # shellcheck disable=SC2086 # we need the word splitting - start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \ - -- $HTTPD_ARGS + start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" -- $HTTPD_ARGS status=$? if [ "$status" -eq 0 ]; then echo "OK" @@ -56,10 +54,13 @@ restart() { case "$1" in start|stop|restart) - "$1";; + "$1" + ;; + reload) - # Restart, since there is no true "reload" feature. - restart;; + restart + ;; + *) echo "Usage: $0 {start|stop|restart|reload}" exit 1 diff --git a/general/package/webui/webui.mk b/general/package/webui/webui.mk index 0407c4c9..4ac06e04 100644 --- a/general/package/webui/webui.mk +++ b/general/package/webui/webui.mk @@ -12,11 +12,10 @@ WEBUI_LICENSE_FILES = LICENSE define WEBUI_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -d $(TARGET_DIR)/etc - cp $(WEBUI_PKGDIR)/files/httpd.conf $(TARGET_DIR)/etc + $(INSTALL) -m 644 -t $(TARGET_DIR)/etc $(WEBUI_PKGDIR)/files/etc/* $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d - cp $(WEBUI_PKGDIR)/files/S50httpd $(TARGET_DIR)/etc/init.d - cp -rv $(@D)/files/etc/init.d/* $(TARGET_DIR)/etc/init.d + $(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(WEBUI_PKGDIR)/files/init.d/* $(INSTALL) -m 755 -d $(TARGET_DIR)/usr cp -rv $(@D)/files/usr/sbin $(TARGET_DIR)/usr