Ksmbd (Samba3/4 alternative, ex cifsd/smbd) package support thread

Hi, I'm testing the current snapshot r15223. The ksmbd service is always semi-killed at system startup.

  • Kernel message:

[ 29.366912] ksmbd: kill command received

  • system log
root@OpenWrt:~# logread |grep smb
Sun Dec  6 00:26:17 2020 daemon.notice ksmbd: Starting Ksmbd userspace service.
Sun Dec  6 00:26:19 2020 daemon.info ksmbd: triggering kill_server
Sun Dec  6 00:26:19 2020 daemon.notice ksmbd: Starting Ksmbd userspace service.
Sun Dec  6 00:26:19 2020 kern.info kernel: [   29.494030] ksmbd: kill command received

Solved with this patch (sleep added):

diff --git a/net/ksmbd-tools/files/ksmbd.init b/net/ksmbd-tools/files/ksmbd.init
index 5eb347085..a1ec924d2 100644
--- a/net/ksmbd-tools/files/ksmbd.init
+++ b/net/ksmbd-tools/files/ksmbd.init
@@ -169,6 +169,7 @@ start_service()
 	
 	# 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
+	sleep 3
 	
 	[ ! -e /sys/module/ksmbd ] && modprobe ksmbd 2> /dev/null
 	if [ ! -e /sys/module/ksmbd ]; then

Probably there is a better way to fix it, but this may help to show the bug.

Regards.
Daniel

1 Like