ksmbd-tools: Fix ksmbd service is semi-killed at system startup
authorGeorgi Valkov <gvalkov@abv.bg>
Sun, 28 Nov 2021 17:22:56 +0000 (19:22 +0200)
committerRosen Penev <rosenp@gmail.com>
Mon, 29 Nov 2021 09:24:09 +0000 (01:24 -0800)
The configuration for the ksmbd service is auto-generated when
the OpenWRT configuration changes, and also during startup,
hence ksmbd.init has to reload the kernel module. It does that by
calling kill_server, which does not perform cleanup. This results
in ksmbd being killed but not restarted properly during boot.
This patch resolves the issue by using stop_service, which performs
proper cleanup.

https://forum.openwrt.org/t/ksmbd-samba3-4-alternative-ex-cifsd-smbd-package-support-thread/51695/68

Signed-off-by: Georgi Valkov <gvalkov@abv.bg>
net/ksmbd-tools/Makefile
net/ksmbd-tools/files/ksmbd.init

index 2b137347b45d246b4d23c559c27c3c6b5f38ac8b..ad74c28e0ce907b03a0a407d7b982b3ea98c28bc 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ksmbd-tools
 PKG_VERSION:=3.4.2
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cifsd-team/ksmbd-tools/tar.gz/$(PKG_VERSION)?
index 2c296b10b7a403f7e0fcd5dba09bf82173dec37c..7c628e826d814608a03fea8a47f216af456ab33c 100644 (file)
@@ -151,7 +151,7 @@ start_service()
        fi
        
        # NOTE: We don't do a soft-reload via signal, since [global] smb.conf setting changes will be ignored, so always reset hard.
-       kill_server
+       [ -e /sys/module/ksmbd ] && stop_service
        
        [ ! -e /sys/module/ksmbd ] && modprobe ksmbd 2> /dev/null
        if [ ! -e /sys/module/ksmbd ]; then