Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Installing samba on ZFS inside container #3442
Comments
|
You may want to also set "xattr" to "sa" on your ZFS filesystem but I'm not sure if that's the cause of the problem here. Any chance you can re-run just the failing command to reproduce the crash and if that works, then run it under strace to see exactly what syscall failed? |
|
I do run 6 samba4 domain controllers inside unprivileged LXD containers on ZFS, but those aren't deployed with zentyal, instead just directly installed on Ubuntu 14.04 or 16.04 and all my ZFS pools have acltype=posixacl and xattr=sa |
stgraber
added
the
Incomplete
label
Jun 26, 2017
laralar
commented
Jun 28, 2017
•
|
i did the xattr=sa an executed command line with strace, does it seems to be something related with the chown?
|
laralar
commented
Jun 28, 2017
•
|
It sees that the chown 0:3000000 on /var/lib/samba/sysvol is not accepted .. it actually only accepts 65535 as max GID i tried increasing GID_MAX in /etc/login.defs in the container to no avail Do I need to change some parameters in the host? lxd:100000:1000000000 |
laralar
commented
Jun 28, 2017
|
as a privileged container it seems there are no issues |
|
Hmm, so those subuid and subgid value should be enough to avoid that particular issue. |
|
And the content of /var/log/lxd/lxd.log would be useful too, just to make sure your subuid/subgid was parsed properly. |
laralar
commented
Jul 3, 2017
•
|
Ok.. maybe I posted some misleading information. I am not getting the UID/GID issue anymore. I am restoring a snapshot, then executing strace samba-tool domain provision --domain='aibl' --realm='AIBL.NET' --dns-backend=BIND9_DLZ --use-xattrs=yes --use-rfc2307 --function-level=2003 --server-role='dc' --host-name='zentyal' --host-ip='10.30.60.250' --adminpass=am.acl.!0T 2>&1 | tee strace-samba.log What I am getting is this:
I have executed |
laralar
commented
Jul 3, 2017
•
|
|
Hi, Good, so the strace does show the problem is caused by an attempt to write to "security.NTACL". My understanding of the xattr kernel code is that the "security" namespace is restricted to real root and therefore cannot be used by unprivileged containers. That namespace is usually used for data that the kernel itself sets or parses, such as filesystem capabilities, IMA checksums, ... It's unclear to me why samba is using that namespace for the Windows ACLs since as far as I know, there's no kernel interaction with those. I'm afraid that if samba requires the ability to write custom xattrs in the "security" namespace, then the only way to have things work will be to run the container as real root (privileged). That's assuming there's no way for you to tell zentyal to configure samba in a way where it doesn't use those custom xattrs. @hallyn does that make sense to you? |
laralar
commented
Jul 3, 2017
|
why is this configuration of samba using this "feature"? you said you had samba running on unprivileged containers, right? because I don't see anything special in zentyal smb.cnf root@zentyal:~# cat /etc/samba/smb.conf
[netlogon] [sysvol] |
laralar
commented
Jul 3, 2017
•
|
and shares.conf . #maybe the line in bold?.. Nop, I commented that line and the error is still there [homes] |
|
Earlier in this issue you showed your samba-tool command as spawned by Zentyal, that included "--use-xattrs=yes" which I suspect is what's causing most of the problem. I am using samba4 in containers as a domain controller, not as a file server so I may also be avoiding a number of xattr related issues because of that. |
|
@stgraber, samba requires that the |
|
Ok, so closing this then as there's nothing LXD can really do about this. |
stgraber
closed this
Jul 5, 2017
JLKreider
commented
Sep 28, 2017
|
@stgraber, can you confirm that the DC that you are running in unprivileged containers are NT DCs and not AD DCs? I found this thread while trying to get both Samba AD DCs and Samba file servers to run in unprivileged containers AND use NT ACLs. My understanding is that AD DCs require the NT ACLs which in turn seem to require access to the security.ntacl namespace. If you are running AD DCs in unprivileged containers, then I need to go back and try again. |
|
I'm running an AD DC, but that's a DC only (it does offer netlogon$ but that's about it). For serving files I have another unprivileged container running samba3. |
laralar commentedJun 24, 2017
Required information
Issue description
I'm trying to install SAMBA on a ZFS container. for that I executed the following command
'zfs set acltype=posixacl vol0/lxd/containers/zentyal`
I restarted the container, just in case,
Steps to reproduce
It is an unprivileged container, installing zentyal Domain Controller which installs samba and gives the following output in zentyal.log
Information to attach
`
2017/06/24 08:41:49 ERROR> GlobalImpl.pm:661 EBox::GlobalImpl::saveAllModules - Failed to save changes in module samba: root command samba-tool domain provision --domain='aibl' --realm='AIBL.NET' --dns-backend=BIND9_DLZ --use-xattrs=yes --use-rfc2307 --function-level=2003 --server-role='dc' --host-name='zentyal' --host-ip='10.30.60.250' --adminpass='cat /var/lib/zentyal/tmp/VV7Qtr' failed.
Error output: lpcfg_load: refreshing parameters from /etc/samba/smb.conf
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
...
set_nt_acl: chown /var/lib/samba/sysvol. uid = 0, gid = 3000000.
Security context active token stack underflow!
PANIC (pid 8094): Security context active token stack underflow!
BACKTRACE: 44 stack frames:
#0 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(log_stack_trace+0x1c) [0x7f165143dc0c]
#1 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(smb_panic_s3+0x20) [0x7f165143dce0]
#2 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(smb_panic+0x2f) [0x7f166404819f]
#3 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(sec_ctx_active_token+0x83) [0x7f164dbbf8e3]
#4 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(try_chown+0xa9) [0x7f164dbcb5d9]
#5 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(set_nt_acl+0x1ce) [0x7f164dbcb7fe]
#6 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(+0x1e2ef1) [0x7f164dc91ef1]
#7 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smb_vfs_call_fset_nt_acl+0x2d) [0x7f164dbc3cfd]
#8 /usr/lib/x86_64-linux-gnu/samba/vfs/acl_xattr.so(+0x23d9) [0x7f163e8d83d9]
#9 /usr/lib/x86_64-linux-gnu/samba/vfs/acl_xattr.so(+0x4ff6) [0x7f163e8daff6]
#10 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smb_vfs_call_fset_nt_acl+0x2d) [0x7f164dbc3cfd]
#11 /usr/lib/python2.7/dist-packages/samba/samba3/smbd.x86_64-linux-gnu.so(+0x25f4) [0x7f164dff55f4]
#12 /usr/bin/python2.7(PyEval_EvalFrameEx+0x6da2) [0x4cada2]
#13 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#14 /usr/bin/python2.7(PyEval_EvalFrameEx+0x6099) [0x4ca099]
#15 /usr/bin/python2.7(PyEval_EvalFrameEx+0x5d8f) [0x4c9d8f]
#16 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#17 /usr/bin/python2.7(PyEval_EvalFrameEx+0x6099) [0x4ca099]
#18 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#19 /usr/bin/python2.7(PyEval_EvalFrameEx+0x6099) [0x4ca099]
#20 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#21 /usr/bin/python2.7() [0x4de8b8]
#22 /usr/bin/python2.7(PyObject_Call+0x43) [0x4b0cb3]
#23 /usr/bin/python2.7(PyEval_EvalFrameEx+0x2ad1) [0x4c6ad1]
#24 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#25 /usr/bin/python2.7() [0x4de6fe]
#26 /usr/bin/python2.7(PyObject_Call+0x43) [0x4b0cb3]
#27 /usr/bin/python2.7(PyEval_EvalFrameEx+0x2ad1) [0x4c6ad1]
#28 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#29 /usr/bin/python2.7() [0x4de6fe]
#30 /usr/bin/python2.7(PyObject_Call+0x43) [0x4b0cb3]
#31 /usr/bin/python2.7(PyEval_EvalFrameEx+0x2ad1) [0x4c6ad1]
#32 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#33 /usr/bin/python2.7() [0x4de6fe]
#34 /usr/bin/python2.7(PyObject_Call+0x43) [0x4b0cb3]
#35 /usr/bin/python2.7(PyEval_EvalFrameEx+0x2ad1) [0x4c6ad1]
#36 /usr/bin/python2.7(PyEval_EvalCodeEx+0x255) [0x4c2765]
#37 /usr/bin/python2.7(PyEval_EvalCode+0x19) [0x4c2509]
#38 /usr/bin/python2.7() [0x4f1def]
#39 /usr/bin/python2.7(PyRun_FileExFlags+0x82) [0x4ec652]
#40 /usr/bin/python2.7(PyRun_SimpleFileExFlags+0x191) [0x4eae31]
#41 /usr/bin/python2.7(Py_Main+0x68a) [0x49e14a]
#42 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f16651b2830]
#43 /usr/bin/python2.7(_start+0x29) [0x49d9d9]
Can not dump core: corepath not set up
Command output: .
Exit value: 1
2017/06/24 08:41:49 INFO> Base.pm:231 EBox::Module::Base::save - Restarting service for module: logs
2017/06/24 08:41:50 ERROR> GlobalImpl.pm:736 EBox::GlobalImpl::saveAllModules - The following modules failed while saving their changes, their state is unknown: samba at The following modules failed while saving their changes, their state is unknown: samba at /usr/share/perl5/EBox/GlobalImpl.pm line 736
EBox::GlobalImpl::saveAllModules('EBox::GlobalImpl=HASH(0x5d5bf40)', 'progress', 'EBox::ProgressIndicator=HASH(0x5d11ee0)') called at /usr/share/perl5/EBox/Global.pm line 95
EBox::Global::AUTOLOAD('EBox::Global=HASH(0x5d12918)', 'progress', 'EBox::ProgressIndicator=HASH(0x5d11ee0)') called at /usr/share/zentyal/global-action line 32
eval {...} at /usr/share/zentyal/global-action line 30
4861,1 Bot
4746,1 97%
`
Any clues?
I am trying to avoid using a VM