[Samba] starting stoping samba 4.11

Reindl Harald h.reindl at thelounge.net
Mon Sep 21 13:41:37 UTC 2020



Am 21.09.20 um 14:47 schrieb jmpatagonia via samba:
> Hello I am using samba Version 4.11.2 compiled.
> 
> To start the daemon I using
> 
> /samba10/samba-4.11.2/bin/samba -s /etc/samba/smb.conf
> 
> To stop correctly, what is recommended ?
> 
> Actually I using kill -9 ...

SIGTERM or use a OS which a proper service manager like systemd which
sends SGTERM to any process in the cgroup at stop

[root at srv-rhsoft:~]$ cat /etc/systemd/system/smb.service
[Unit]
Description=Samba SMB Daemon
After=network-up.service
Requires=network-online.target network-up.service

[Service]
Type=notify
NotifyAccess=all
LimitNOFILE=32768
ExecStart=/usr/sbin/smbd  --foreground --no-process-group
ExecReload=/usr/bin/kill -HUP $MAINPID
PermissionsStartOnly=true
Restart=always
RestartSec=1
Nice=19

PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
MemoryDenyWriteExecute=yes
CapabilityBoundingSet=CAP_CHOWN CAP_SETGID CAP_SETUID CAP_DAC_OVERRIDE
CAP_NET_BIND_SERVICE CAP_IPC_LOCK CAP_SYS_CHROOT

SystemCallFilter=@system-service @network-io @privileged @resources
SystemCallFilter=~@debug @module @mount @reboot



More information about the samba mailing list