prosody: fix shellcheck warnings
authorRosen Penev <rosenp@gmail.com>
Thu, 15 Oct 2020 03:07:58 +0000 (20:07 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 16 Oct 2020 01:20:20 +0000 (18:20 -0700)
Remove paxctl stuff. pax is not packaged in OpenWrt.

Add reload support.

Install lua cfg file as 644. It's needed to be readable as prosody user

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/prosody/Makefile
net/prosody/files/prosody.init [changed mode: 0644->0755]

index 4c0401abebac064a7a4bdb373ae4ab4740aac050..7bac97154ad81bd00e816d6c3dddb3ecaa2ee032 100644 (file)
@@ -68,8 +68,7 @@ define Package/prosody/install
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/prosody.init $(1)/etc/init.d/prosody
        $(INSTALL_DIR) $(1)/etc/prosody
-       #$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/prosody/prosody.cfg.lua $(1)/etc/prosody/
-       $(INSTALL_CONF) ./files/prosody.cfg.lua $(1)/etc/prosody/
+       $(INSTALL_DATA) ./files/prosody.cfg.lua $(1)/etc/prosody/
        $(INSTALL_DIR) $(1)/etc/prosody/certs
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/prosody/certs/localhost.{crt,key} $(1)/etc/prosody/certs/
        $(INSTALL_DIR) $(1)/etc/prosody/data
old mode 100644 (file)
new mode 100755 (executable)
index a73e682..6bf9379
@@ -6,19 +6,16 @@ START=99
 USE_PROCD=1
 
 BIN=/usr/bin/prosodyctl
-LOG_D=/var/log/prosody
-RUN_D=/var/run/prosody
-PID_F=$RUN_D/prosody.pid
-RUN_USER=prosody
-RUN_GROUP=prosody
 
 start_service() {
        [ -d /var/run/prosody ] || {
-               mkdir -m 0755 -p /var/run/prosody
+               mkdir /var/run/prosody
+               chmod 0755 /var/run/prosody
                chown prosody:prosody /var/run/prosody
        }
        [ -d /var/log/prosody ] || {
-               mkdir -m 0755 -p /var/log/prosody
+               mkdir /var/log/prosody
+               chmod 0755 /var/log/prosody
                chown prosody:prosody /var/log/prosody
        }
 
@@ -27,21 +24,18 @@ start_service() {
                chown -R prosody:prosody /etc/prosody/data
        }
 
-       [ -f /sbin/paxctl ] && {
-               paxctl  -v /usr/bin/ > /dev/null  2>&1
-               [ $? -ne 0 ] && {
-                       cp /usr/bin/lua /tmp
-                       paxctl -c -m /tmp/lua
-                       cp -f /tmp/lua /usr/bin/lua
-               }
-       }
-
        procd_open_instance
        procd_set_param command "$BIN" start
        procd_set_param file /etc/prosody/prosody.cfg.lua
+       procd_set_param user prosody
+       procd_set_param group prosody
        procd_close_instance
 }
 
 stop_service() {
        ${BIN} stop
 }
+
+reload_service() {
+       ${BIN} reload
+}