From nobody@FreeBSD.org  Wed Jul  3 08:23:24 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id DE297875
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Jul 2013 08:23:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id D0E591365
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Jul 2013 08:23:24 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r638NO5h082480
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 3 Jul 2013 08:23:24 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r638NO6G082476;
	Wed, 3 Jul 2013 08:23:24 GMT
	(envelope-from nobody)
Message-Id: <201307030823.r638NO6G082476@oldred.freebsd.org>
Date: Wed, 3 Jul 2013 08:23:24 GMT
From: Ben Woods <woodsb02@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net/samba4 port rc script syntax errors ("samba" vs "smbd")
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         180226
>Category:       ports
>Synopsis:       net/samba4 port rc script syntax errors ("samba" vs "smbd")
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    timur
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 03 08:30:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Wed Feb 05 10:23:35 UTC 2014
>Originator:     Ben Woods
>Release:        FreeBSD 9.1-RELEASE-p4
>Organization:
>Environment:
FreeBSD sparticus.home.local 9.1-RELEASE-p4 FreeBSD 9.1-RELEASE-p4 #0: Mon Jun 17 11:42:37 UTC 2013     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Samba4 daemon fails to start via the rc script after installing from ports. This is caused by the following errors in the files/samba4.in rc script:
- incorrect executable file: /usr/local/sbin/samba should be /usr/local/sbin/smbd
- incorrectly PID file: samba.pid should be smbd.pid.

This is confirmed by the following text found in /var/log/samba4/log.%m:

[2013/07/03 15:24:42,  0] ../source4/smbd/server.c:461(binary_smbd_main)
  At this time the 'samba' binary should only be used for either:
  'server role = active directory domain controller' or to access the ntvfs file server with 'server services = +smb' or the rpc proxy with 'dcerpc endpointservers = remote'
  You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
>How-To-Repeat:
1. Install net/samba4-4.0.4_1 from ports or packages
2. Add samba4_enable="YES" to /etc/rc.conf
3. Run # service samba4 start
4. Review running status via # service samba4 status
5. Review log file at /var/log/samba4/log.%m
>Fix:
Modify rc script (files/samba4.in) in port net/samba4:

42c42
< command="%%PREFIX%%/sbin/${name}"
---
> command="%%PREFIX%%/sbin/smbd"

44c44
< pidfile="%%SAMBA4_RUNDIR%%/samba.pid"
---
> pidfile="%%SAMBA4_RUNDIR%%/smbd.pid"

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->timur 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Jul 3 08:30:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=180226 

From: "Timur I. Bakeyev" <timur@FreeBSD.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/180226: net/samba4 port rc script syntax errors ("samba" vs "smbd")
Date: Thu, 4 Jul 2013 07:17:13 +0200

 --047d7b8736ca1a2d2604e0a8b2a6
 Content-Type: text/plain; charset=ISO-8859-1
 
 Thanks, you made my day with this PR :)
 
 
 --047d7b8736ca1a2d2604e0a8b2a6--

From: Mark Foster <mark@foster.cc>
To: bug-followup@FreeBSD.org, woodsb02@gmail.com
Cc:  
Subject: Re: ports/180226: net/samba4 port rc script syntax errors (&quot;samba&quot;
 vs &quot;smbd&quot;)
Date: Thu, 01 Aug 2013 18:50:58 -0700

 Had the exact same issue, fixed by modifying the rc script as indicated.

From: Ben Woods <woodsb02@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/180226: net/samba4 port rc script syntax errors
 (&quot;samba&quot; vs &quot;smbd&quot;)
Date: Thu, 12 Sep 2013 20:18:22 +0800

 --e89a8f3ba36fe88e8804e62ebb9f
 Content-Type: text/plain; charset=ISO-8859-1
 
 This issue still seems to exist in the latest port (currently samba4-4.0.8).
 
 With the new rc script (files/samba4.in) in port net/samba4, the fix is a
 little different, in that now the command_name simply needs to be changed
 from samba to smbd:
 
 42c42
 < command_name="samba"
 ---
 > command_name="smbd"
 
 Cheers,
 Ben
 
 --
 From: Benjamin Woods
 woodsb02@gmail.com
 
 --e89a8f3ba36fe88e8804e62ebb9f--

Date: Wed, 5 Feb 2014 10:17:05 +0800
From: Ben Woods <woodsb02@gmail.com>
To: bug-followup@FreeBSD.org
Subject: Re: net/samba4 port rc script syntax errors ("samba" vs "smbd")

 --047d7b86dbd85eb5d004f19f5a29
 Content-Type: text/plain; charset=ISO-8859-1
 
 This appears to be resolved with the new "samba_server" rc script in
 samba41.
 
 A quote from "UPDATING" for samba41:
 
 With the introduction of Samba 4.1 corresponding port lost SWAT support
   and made WINBIND support mandatory. As samba4 introduced additional 'samba'
   daemon to the tripplet of nmbd/smbd/winbindd to avoid confusion startup
   script for samba41 was renamed to 'samba_server'. To start the whole band
   up it's enough to add to the rc.conf:
 
   samba_server_enable="YES"
 
   Startup script tries it's best to guess which out of samba/nmbd/smbd/winbindd
   daemons have to be started, but you can fine tune this by specifying them in
   rc.conf, just make sure that samba_server_enable is enabled(see
 entry for 20121022).
 
 
 Regards,
 Ben
 
 --
 From: Benjamin Woods
 woodsb02@gmail.com
 
 --047d7b86dbd85eb5d004f19f5a29--
>Unformatted:
