# Samba 4 update to 4.0.12 fails



## ulzeraj (Nov 20, 2013)

I already have a working installation of a SAMBA4 DC. Upgrade fails as shown in http://pastebin.com/GSb0r7rp

I've already tried recompiling and reinstalling the dependencies talloc, tdb and tevent but I doubt this is the issue. It seems the port itself seems to be trying to link against the existing libraries instead of the new ones.

If anyone knows how to deal with this stuff please tell me.


```
$ cat /var/db/ports/net_samba4/options 
# This file is auto-generated by 'make config'.
# Options for samba4-4.0.12
_OPTIONS_READ=samba4-4.0.12
_FILE_COMPLETE_OPTIONS_LIST=ACL_SUPPORT ADS AIO_SUPPORT CUPS DEBUG DEVELOPER DNSUPDATE EXP_MODULES FAM_SUPPORT LDAP MANPAGES PAM_SMBPASS PTHREADPOOL QUOTAS SWAT SYSLOG UTMP WINBIND NSUPDATE BIND98 BIND99 AVAHI MDNSRESPONDER
OPTIONS_FILE_SET+=ACL_SUPPORT
OPTIONS_FILE_SET+=ADS
OPTIONS_FILE_SET+=AIO_SUPPORT
OPTIONS_FILE_SET+=CUPS
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_UNSET+=DEVELOPER
OPTIONS_FILE_SET+=DNSUPDATE
OPTIONS_FILE_SET+=EXP_MODULES
OPTIONS_FILE_SET+=FAM_SUPPORT
OPTIONS_FILE_SET+=LDAP
OPTIONS_FILE_SET+=MANPAGES
OPTIONS_FILE_SET+=PAM_SMBPASS
OPTIONS_FILE_SET+=PTHREADPOOL
OPTIONS_FILE_SET+=QUOTAS
OPTIONS_FILE_UNSET+=SWAT
OPTIONS_FILE_SET+=SYSLOG
OPTIONS_FILE_SET+=UTMP
OPTIONS_FILE_UNSET+=WINBIND
OPTIONS_FILE_SET+=NSUPDATE
OPTIONS_FILE_UNSET+=BIND98
OPTIONS_FILE_UNSET+=BIND99
OPTIONS_FILE_SET+=AVAHI
OPTIONS_FILE_UNSET+=MDNSRESPONDER
```

System arch is amd64. Thanks.


----------



## fulano (Nov 21, 2013)

You have to delete samba4-4.0.8 first: `pkg delete samba4`. Then recompile samba4-4.0.12.


----------



## ulzeraj (Dec 1, 2013)

It installs but doesn't work off the bat. I had to remove all the files from /var/db/samba4 except sysvol and private. I also had to remove everything from /var/run/samba4. It works now but I'm having the following issues now:


```
# service samba4 start
install: mkdir : No such file or directory
Starting samba4.
```


```
# service samba4 restart
Performing sanity check on Samba configuration: Segmentation fault (core dumped)
FAILED
```

It seems some Python stuff is misbehaving:

```
# dmesg
pid 10465 (python2.7), uid 0: exited on signal 11 (core dumped)
pid 10470 (python2.7), uid 0: exited on signal 11 (core dumped)
pid 10475 (python2.7), uid 0: exited on signal 11 (core dumped)
pid 10483 (python2.7), uid 0: exited on signal 11 (core dumped)
```

Aside from that there are no error prints on Samba logs and the system appears to be working fine. Perhaps its something related to the init scripts? I should mention here that the system rootfs is a ZFS dataset except for the sysvol directory which is a UFS formatted zvol.


EDIT: issue seems to come from the following command issued by the samba4 init script:
`/usr/local/bin/samba-tool testparm --suppress-prompt --verbose --configfile=/usr/local/etc/smb4.conf`

It segfaults. Strangely the command `testparm` runs fine. How can I debug the samba-tool output?

Thanks!


----------



## mix_room (Dec 7, 2013)

I have the same problem. 

`# samba-tool testparm` gives a segmentation fault, but only `# testparm` does not. 

I have the same Python faults as you do.


----------



## mix_room (Dec 9, 2013)

```
# pkg info | grep pyth
py27-dnspython-1.11.1          DNS toolkit for Python
python-2.7_1,2                 The \"meta-port\" for the default version of Python interpreter
python2-2_1                    The \"meta-port\" for version 2 of the Python interpreter
python27-2.7.6                 Interpreted object-oriented programming language
```
I also noticed that I have three different versions of Python installed. I am guessing this could be a problem.


----------



## mix_room (Dec 10, 2013)

For the sake of completeness, it still fails after I upgraded to 4.0.13.


----------



## ulzeraj (Dec 25, 2013)

On _an_other system using 10.0-RC2 I'm getting constant core dumps with other application_s_ too (Plex Media Server). I'm starting to believe it*'*s a Python problem.


----------



## mix_room (Jan 6, 2014)

You should probably submit a PR in that case.


----------



## frankpeng (Jan 12, 2014)

I have upgraded to 10.0-RC5. The samba4 port now is 4.0.13. Still has the same problem as you guys. I use 
	
	



```
killall samba
```
 to stop samba4 and `service samba4 start` to start. Do not use `service samba4 restart`


----------



## sirOliver (Mar 1, 2014)

Had the same issue with Samba 4.1.4 compiled from ports under FreeBSD 10-RELEASE. Turned out libiconv was missing.


```
# samba-tool 
Traceback (most recent call last):
  File "/usr/local/bin/samba-tool", line 33, in <module>
    from samba.netcmd.main import cmd_sambatool
  File "/usr/local/lib/python2.7/site-packages/samba/__init__.py", line 27, in <module>
    import samba.param
ImportError: Shared object "libiconv.so.3" not found, required by "libsamba-util.so.0"
```

Installed that and now it works like a charm.


----------

