summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-04-09 02:09:22 -0700
committerAndrew Bartlett <abartlet@samba.org>2012-04-16 09:38:17 +0200
commitf35d20119a3a6992cb3a9be047dbd723470d4b86 (patch)
tree6042652d4c9ff9062c97ba58be034aecaf02c48d /source4
parent4d872ff77f95b0aa48063d04cbc18e56f056bfc9 (diff)
downloadsamba-f35d20119a3a6992cb3a9be047dbd723470d4b86.tar.gz
samba-f35d20119a3a6992cb3a9be047dbd723470d4b86.tar.bz2
samba-f35d20119a3a6992cb3a9be047dbd723470d4b86.zip
Add an option to have s3fs as file server for samba4
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Apr 16 09:38:18 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py27
-rwxr-xr-xsource4/setup/provision3
2 files changed, 21 insertions, 9 deletions
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index d138c9e423..6bb09b7fe9 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -588,7 +588,7 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None,
def make_smbconf(smbconf, hostname, domain, realm, targetdir,
serverrole=None, sid_generator=None, eadb=False, lp=None,
- server_services=None):
+ global_param=None):
"""Create a new smb.conf file based on a couple of basic settings.
"""
assert smbconf is not None
@@ -630,8 +630,10 @@ def make_smbconf(smbconf, hostname, domain, realm, targetdir,
privdir = lp.get("private dir")
lp.set("posix:eadb", os.path.abspath(os.path.join(privdir, "eadb.tdb")))
- if server_services is not None:
- global_settings["server services"] = " ".join(server_services)
+ if global_param is not None:
+ for ent in global_param:
+ if global_param[ent] is not None:
+ global_settings[ent] = " ".join(global_param[ent])
if targetdir is not None:
global_settings["private dir"] = os.path.abspath(os.path.join(targetdir, "private"))
@@ -1591,7 +1593,7 @@ def provision(logger, session_info, credentials, smbconf=None,
backend_type=None, sitename=None,
ol_mmr_urls=None, ol_olc=None, slapd_path=None,
useeadb=False, am_rodc=False,
- lp=None):
+ lp=None, use_ntvfs=True):
"""Provision samba4
:note: caution, this wipes all existing data!
@@ -1637,9 +1639,18 @@ def provision(logger, session_info, credentials, smbconf=None,
if not os.path.exists(os.path.dirname(smbconf)):
os.makedirs(os.path.dirname(smbconf))
- server_services = None
+ server_services = []
+ global_param = {}
if dns_backend == "SAMBA_INTERNAL":
- server_services = ["+dns"]
+ server_services.append("+dns")
+
+ if not use_ntvfs:
+ server_services.append("-smb")
+ server_services.append("+s3fs")
+ global_param["vfs objects"] = ["acl_xattr"]
+
+ if len(server_services) > 0:
+ global_param["server services"] = server_services
# only install a new smb.conf if there isn't one there already
if os.path.exists(smbconf):
@@ -1655,11 +1666,11 @@ def provision(logger, session_info, credentials, smbconf=None,
make_smbconf(smbconf, hostname, domain, realm,
targetdir, serverrole=serverrole,
sid_generator=sid_generator, eadb=useeadb,
- lp=lp, server_services=server_services)
+ lp=lp, global_param=global_param)
else:
make_smbconf(smbconf, hostname, domain, realm, targetdir,
serverrole=serverrole, sid_generator=sid_generator,
- eadb=useeadb, lp=lp, server_services=server_services)
+ eadb=useeadb, lp=lp, global_param=global_param)
if lp is None:
lp = samba.param.LoadParm()
diff --git a/source4/setup/provision b/source4/setup/provision
index 554a516802..523b082827 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -122,6 +122,7 @@ parser.add_option("--ol-mmr-urls", type="string", metavar="LDAPSERVER",
parser.add_option("--slapd-path", type="string", metavar="SLAPD-PATH",
help="Path to slapd for LDAP backend [e.g.:'/usr/local/libexec/slapd']. Required for Setup with LDAP-Backend. OpenLDAP Version >= 2.4.17 should be used.")
parser.add_option("--use-xattrs", type="choice", choices=["yes", "no", "auto"], help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto")
+parser.add_option("--use-s3fs", help="Use s3fs for the fileserver (default = no)")
opts = parser.parse_args()[0]
@@ -265,7 +266,7 @@ try:
backend_type=opts.ldap_backend_type,
ldapadminpass=opts.ldapadminpass, ol_mmr_urls=opts.ol_mmr_urls,
slapd_path=opts.slapd_path,
- useeadb=eadb, next_rid=opts.next_rid, lp=lp)
+ useeadb=eadb, next_rid=opts.next_rid, lp=lp, use_ntvfs=(not opts.use_s3fs))
except ProvisioningError, e:
print str(e)
sys.exit(1)