[Samba] starting stoping samba 4.11

Reindl Harald h.reindl at thelounge.net
Tue Sep 22 06:23:21 UTC 2020



Am 22.09.20 um 03:04 schrieb jmpatagonia via samba:
> Reindl on the compiled version the samba binary file is not in
> /usr/sbin/smbd and i think start whith samba  file not with smbd

and how does that matter?

that's what "/etc/systemd/system/" is for
just adopt the path and depending on how it was built change
"Type=notify" to "simple" or "forking"

> El lun., 21 sept. 2020 10:41, Reindl Harald <h.reindl at thelounge.net>
> escribió:
> 
>>
>>
>> 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