Bug 257188

Summary: net/samba4*: samba_server service file force runs all daemons if called with 'onestart'
Product: Ports & Packages Reporter: Emrion <kmachine>
Component: Individual Port(s)Assignee: Timur I. Bakeyev <timur>
Status: New ---    
Severity: Affects Some People CC: kmachine, miwi, ports-bugs, timur, vlad-fbsd, zurvan.akarana
Priority: --- Keywords: needs-qa
Version: LatestFlags: linimon: maintainer-feedback? (timur)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to get the same behavour with start or onestart command none

Description Emrion 2021-07-14 16:57:45 UTC
+++ This bug was initially created as a clone of Bug #209660 +++

This clause in /usr/local/etc/rc.d/samba_server (lines 120-122):

>     if [ -n "${_rc_prefix}" -a "${_rc_prefix}" = "one" ] || [ -n "${rc_force}" ] || [ -n "${rc_fast}" ]; then
>         force_run=yes
>     fi

forces nmbd and winbindd to be started regardless of the values of nmbd_enable and winbindd_enable in /etc/rc.conf.

If one wants to start samba_server manually (without having set samba_server_enable="YES") after boot they have no option but to use 'onestart' but then that will ignore disabling of nmbd and winbindd in rc.conf; even in situations where 'disable netbios = yes' is explicitly set in smb4.conf.

This leaves one with no option to start only smbd manually after boot without forcibly launching nmbd and winbindd which many not be desired in some scenarios.

This was checked with samba_server script shipped with samba41-4.1.22_2.
Comment 1 Emrion 2021-07-14 17:00:53 UTC
Created attachment 226466 [details]
patch to get the same behavour with start or onestart command
Comment 2 Emrion 2021-07-14 17:04:44 UTC
(In reply to Emrion from comment #1)
This patch is intended to be applied on /usr/local/etc/rc.d/samba_server