From nobody Wed Jun 30 18:04:19 2021 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EC66111DFBFE for ; Wed, 30 Jun 2021 18:04:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GFTkW6C0zz3KMv for ; Wed, 30 Jun 2021 18:04:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B95991190C for ; Wed, 30 Jun 2021 18:04:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 15UI4J3v052860 for ; Wed, 30 Jun 2021 18:04:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 15UI4Jng052859 for ports-bugs@FreeBSD.org; Wed, 30 Jun 2021 18:04:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 209660] net/samba4*: samba_server service file force runs all daemons if called with 'onestart' Date: Wed, 30 Jun 2021 18:04:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kmachine@free.fr X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Feedback Timeout X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209660 --- Comment #3 from Emrion --- I eventually wrote a patch to get the same behaviour, whether samba_server = is started by 'start' or 'onestart' command. The idea is that the variable $samba_daemons should contain only the daemon names it is supposed to start (mainly depending on rc.conf values). I follo= wed all the indications I found in the code and it seems to work. In some way, = the code of samba_server_config_init() is even simplified. The patch is applicable at least for samba412 & 413. Seems the code of this script hasn't changed since long time. Applying this patch, you get this: -------------------------- samba_server_defaultyes() { load_rc_config $1 eval ${1}_enable=3D\${${1}_enable-YES} if checkyesno ${1}_enable; then samba_daemons=3D"$samba_daemons $1" fi } samba_server_config_init() { # Load configuration load_rc_config "${name}" # Defaults samba_server_enable=3D${samba_server_enable:=3DNO} samba_server_config=3D${samba_server_config=3D${samba_server_config_def= ault}} =20=20=20 samba_server_configfile_arg=3D${samba_server_config:+--configfile=3D"${samb= a_server_config}"} #" #testparm_command=3D"/usr/local/bin/samba-tool testparm --suppress-prom= pt --verbose ${samba_server_configfile_arg}" testparm_command=3D"/usr/local/bin/testparm --suppress-prompt --verbose ${samba_server_config}" # Determine what daemons are necessary to run Samba in the current role samba_server_role=3D$(${testparm_command} --parameter-name=3D'server ro= le' 2>/dev/null) case "${samba_server_role}" in active\ directory\ domain\ controller) samba_server_defaultyes "samba" ;; auto|*) samba_server_defaultyes "nmbd" samba_server_defaultyes "smbd"=20=20=20=20 # Winbindd will be active if it's set to "YES" in rc.conf # or if 'idmap id' is defined in smb4.conf load_rc_config "winbindd" samba_server_idmap=3D$(${testparm_command} --parameter-name=3D'= idmap uid' 2>/dev/null) if [ -n "${samba_server_idmap}" ]; then winbindd_enable=3D"YES" fi if [ -n "$winbindd_enable" ] && checkyesno winbindd_enable; then samba_daemons=3D"${samba_daemons} winbindd" fi ;; esac # Fetch parameters from configuration file samba_server_lockdir=3D"$(${testparm_command} --parameter-name=3D'lock directory' 2>/dev/null)" samba_server_lockdir=3D${samba_server_lockdir:=3D/var/db/samba4} samba_server_piddir=3D"$(${testparm_command} --parameter-name=3D'pid di= rectory' 2>/dev/null)" samba_server_piddir=3D${samba_server_piddir:=3D/var/run/samba4} samba_server_privatedir=3D"$(${testparm_command} --parameter-name=3D'pr= ivate dir' 2>/dev/null)" samba_server_privatedir=3D${samba_server_privatedir:=3D/var/db/samba4/p= rivate} } -------------------------- --=20 You are receiving this mail because: You are the assignee for the bug.=