Samba 4/OS Requirements (日本語)

http://wiki.samba.org/index.php/Samba_4/OS_Requirements の翻訳です。 2013/1/7に翻訳を開始しました。2013/1/8翻訳完了しました。

開発ライブラリとプログラム

Required(要件) :

samba4のビルドを成功させるためにここにあげるパッケージが要求される。

  • Python — Sambaのかなりの部分は pythonを使用して書かれています。自身のビルドシステム(waf)も含みます。

推奨されるオプションの開発ライブラリとプログラム:

ほとんどのディストリビューションではこれらのライブラリは lib-dev とか lib-devel とラベル付けされているでしょう、例をあげると Debianや Ubuntuでは aclは libacl1-devとなっています、しかし Fedora, RHEL, CentOS および openSUSEではそれらは libacl-develと名付けられています。

  • acl — AD DCのデプロイ(配置)に必要となります。もしこのライブラリが含まれない場合でも sambaのビルドは成功するものの、 windowsのフロントエンドから ACLを変更することはできなくなるでしょう。 provisionして +s3fs上で手動で smb.confを設定して、windowsからなにか ACLの変更を試みた場合、Access is denied. エラーを受け取ることになるでしょう。
  • xattr
  • blkid
  • gnutls
  • readline
  • openldap — LDAPサポートの Samba3 コンポーネントをビルドするときに必要になります。
    このライブラリが不足している場合、ビルドは完了しますが、既存の LDAPバックエンドの Samba3からActive Directory Domainへの (アップグレード経由の)provisionは失敗します。 samba-tool domain classicupgradeも参照してください。
  • cups — プリンター共有をサポートする場合
  • bsd or setproctitle – プロセスのタイトルの更新をサポートする場合
  • xsltproc and docbook XSL stylesheets — manページやその他のドキュメントをビルドするのに必要
原文 [click to open]

Development libraries and Programs

Required :

These packages are required for a successful build of samba 4

  • Python — A good portion of Samba is written using python, including the build system itself (waf).

Recommended optional development libraries and Programs:

In most distributions these libraries will be labeled with a lib*-dev or lib*-devel, for example for the Debian or Ubuntu acl would be libacl1-dev, but in Fedora, RHEL, CentOS, and openSUSE its named libacl-devel.

  • acl — Required for a successful AD DC deployment. If this library is not included, samba will build successfully, however you will not be able to change ACL’s from the windows frontend. You will receive and error when you provision and if you manually create the smb.conf with +s3fs, you will get Access is denied. from windows on any attempt to change ACL’s.
  • xattr
  • blkid
  • gnutls
  • readline
  • openldap — Required to build the Samba3 components with LDAP support. Lacking this library the build will complete but attempts to provision (via upgrade) an Active Directory domain from an existing Samba3 LDAP backend will fail. Also see samba-tool domain classicupgrade
  • cups — for printer sharing support
  • bsd or setproctitle – for process title updating support
  • xsltproc and docbook XSL stylesheets — Required for building man pages and other documentation

ディストリビューション設定

以下の例はこれらのライブラリをすべてカバーしています。加えて bind, kerberos および ファイルシステムツールもカバーしています。もし sambaの内臓 DNSサーバーを使用するつもりであれば、 bindは必要ありませんが、nsupdateバイナリを含むパッケージは依然として必要になります。

Debian及び Ubuntu

# apt-get install build-essential libacl1-dev libattr1-dev 
   libblkid-dev libgnutls-dev libreadline-dev python-dev 
   python-dnspython gdb pkg-config libpopt-dev libldap2-dev 
   dnsutils libbsd-dev attr krb5-user docbook-xsl

メモ: docbook-xsl, xlstproc, inkscape は manページのビルドに必要になるでしょう。
メモ: もし winbindサポートの pamが必要であれば、 libpam0g-devパッケージがインストールされている必要があるでしょう。

Debian Lennyの Bindで Dynamically Loadable Zones (DLZ)を有効化する

Dynamically Loadable Zones (DLZ)も利用したい場合、bindのバージョンに応じて対応するオプション (dlopen) を追加するといいでしょう。もしダウンロードした tarボールをコンパイルするのであれば、これらのライブラリが必要になるかもしれません: libkrb5-dev と libssl-dev

$ apt-get install libkrb5-dev libssl-dev
$ tar -zxvf bind9.x.x.tar.gz
$ cd bind9.x.x

Bind9.8.0

$ ./configure --with-gssapi=/usr/include/gssapi  --with-dlz-dlopen=yes

Bind9.8.1 
```sh
$ ./configure --with-gssapi=/usr/include/gssapi  --with-dlopen=yes
$ make
$ make install

Fedora

# yum install libacl-devel libblkid-devel gnutls-devel \
   readline-devel python-devel gdb pkgconfig libattr-devel \
   krb5-workstation

Red Hat Enterprise Linux or CentOS

# yum install libacl-devel libblkid-devel gnutls-devel \
   readline-devel python-devel gdb pkgconfig krb5-workstation \ 
   zlib-devel setroubleshoot-server \
   setroubleshoot-plugins policycoreutils-python \
   libsemanage-python setools-libs-python setools-libs \
   popt-devel libpcap-devel sqlite-devel libidn-devel \
   libxml2-devel libacl-devel libsepol-devel libattr-devel \
   keyutils-libs-devel cyrus-sasl-devel

メモ: docbook-style-xsl.noarch と libxslt.x86_64 は、manページが正常にインストールされるために必要かもしれません。

openSUSE

# zypper install libacl-devel python-selinux autoconf make \
    python-devel gdb sqlite3-devel libgnutls-devel binutils \
    policycoreutils-python setools-libs selinux-policy \
    setools-libs popt-devel libpcap-devel keyutils-devel \
    libidn-devel libxml2-devel libacl-devel libsepol-devel \
    libattr-devel zlib-devel cyrus-sasl-devel gcc \
    krb5-client openldap2-devel libopenssl-devel\
    bind-utils bind-lib

Gentoo

以下のセクションでは、Gentooのパッケージシステムについて少なくとも中級レベルの知識があることを前提にしていますので注意してください。

Python

Gentooでは python-3をデフォルトのpythonインタプリタとしていますが、現在 Sambaでは python-2 (2.4.2以降)が必要となります。以下の一連のコマンドはpython-2 をインストールしてデフォルトのpythonインタプリタとして設定します。

# emerge --ask --noreplace '<dev-lang/python-3'
# eselect python set python2.7
# python-updater

Kerberos

Gentooにおいて、app-crypt/mit-krb5 及び app-crypt/heimdal 、2種類の kerberos実装を選択することができます。残念ながら 2つ同時にインストールすることはできません。現在 Samba開発者は app-crypt/heimdalの使用を推奨しています。 ですので、 (もしインストールされているなら)はじめに app-crypt/mit-krb5をアンインストールし、それから app-crypt/heimdalをインストールして、前のkerberos実装を使用しているすべてのパッケージをリビルドしなければなりません。

# emerge --unmerge --ask app-crypt/mit-krb5
# emerge --ask app-crypt/heimdal
# revdep-rebuild -- -ask

Bind

自動 zone管理を有効化するために、 net-dns/bind と net-dns/bind-tools が berkdb、dlz、gssapiに対してのUSEフラグ付きでemergeされていなければなりません。これらを永続的に有効化するには、次の内容を /etc/package.use に追加します:

net-dns/bind berkdb dlz gssapi
net-dns/bind-tools gssapi

それから、net-dns/bind を emergeします:

# emerge --ask  net-dns/bind net-dns/bind-tools

sambaの bindに対する gssapiアップデートで問題が発生した場合、kerberos実装を app-crypt/mit-krb5 に代えて使用してみてください。

Samba提供のライブラリ (tdb/ldb/tevent)

ここではインストールされるべきいくつかの Sambaライブラリについて書きます。 これらのパッケージは安定版ではないとキーワードされているかもしれないので注意してください、そしてそのために /etc/package.keywordsに以下を追記する必要があるかもしれません:

~sys-libs/tevent-0.9.17
~sys-libs/tdb-1.2.10
~sys-libs/ldb-1.1.12
~sys-libs/talloc-2.0.7

加えて、Sambaは sys-libs/tdb と sys-libs/talloc が pythonに USEフラグ付きで emergeされていることを求めます。これを永続的に有効化するには、以下を /etc/package.use に追加します:

sys-libs/tdb python
sys-libs/talloc python

メモ: 新しい gentooのインストールでは、上記のファイルは /etc/portage にあります(たとえば /etc/portage/package.keywords や /etc/portage/package.use)。
これらは下位互換のために /etc にシンボリックリンクされています。 パッケージを emergeしましょう:

# emerge --ask '=sys-libs/talloc-2.0.7' '=sys-libs/tdb-1.2.10' '=sys-libs/tevent-0.9.17' '=sys-libs/ldb-1.1.12'

上記のパッケージに、必要なバージョンのための ebuildは portageツリーで利用できないかもしれないことに注意してください。この場合、ebuildの更新について GentooのBugzillaをチェックして下さい。

その他の ビルド/実行の依存関係

Samba-4のインストール成功を保証するためにインストールすべきいくつかのその他のパッケージを下記に示します:

# emerge --ask net-libs/gnutls sys-apps/acl dev-libs/cyrus-sasl dev-python/subunit dev-python/dnspython net-dns/libidn 

FIXME: dev-python/dnspython net-dns/libidn はまだ必要? FIXME: Are dev-python/dnspython net-dns/libidn still required?

原文

Distribution Setup

The examples following will cover all of these libraries. It will also cover bind, kerberos, and file system tools. If you plan to use the internal DNS server, you do not need bind, but you do still need the package that contains the nsupdate binary.

Debian or Ubuntu

# apt-get install build-essential libacl1-dev libattr1-dev \
   libblkid-dev libgnutls-dev libreadline-dev python-dev \
   python-dnspython gdb pkg-config libpopt-dev libldap2-dev \
   dnsutils libbsd-dev attr krb5-user docbook-xsl

Note: docbook-xsl, xsltproc, and inkscape may be required for building the man pages. Note: if you need pam winbind support you will need the libpam0g-dev package installed.

Enabling Dynamically Loadable Zones (DLZ) with Bind on Debian Lenny

If you also want to use Dynamically Loadable Zones (DLZ) then you should add the corresponding option (dlopen) depending on your version of bind. If you are about to compile a downloaded tarball you might need these libraries: libkrb5-dev and libssl-dev

 $ apt-get install libkrb5-dev libssl-dev
 $ tar -zxvf bind9.x.x.tar.gz
 $ cd bind9.x.x

Bind9.8.0

 $ ./configure --with-gssapi=/usr/include/gssapi  --with-dlz-dlopen=yes

Bind9.8.1

 $ ./configure --with-gssapi=/usr/include/gssapi  --with-dlopen=yes
 $ make
 $ make install

Fedora

# yum install libacl-devel libblkid-devel gnutls-devel \
   readline-devel python-devel gdb pkgconfig libattr-devel \
   krb5-workstation

Red Hat Enterprise Linux or CentOS

# yum install libacl-devel libblkid-devel gnutls-devel \
   readline-devel python-devel gdb pkgconfig krb5-workstation \ 
   zlib-devel setroubleshoot-server \
   setroubleshoot-plugins policycoreutils-python \
   libsemanage-python setools-libs-python setools-libs \
   popt-devel libpcap-devel sqlite-devel libidn-devel \
   libxml2-devel libacl-devel libsepol-devel libattr-devel \
   keyutils-libs-devel cyrus-sasl-devel

Note: docbook-style-xsl.noarch and libxslt.x86_64 may be required for the man pages to get installed correctly.

openSUSE

# zypper install libacl-devel python-selinux autoconf make \
    python-devel gdb sqlite3-devel libgnutls-devel binutils \
    policycoreutils-python setools-libs selinux-policy \
    setools-libs popt-devel libpcap-devel keyutils-devel \
    libidn-devel libxml2-devel libacl-devel libsepol-devel \
    libattr-devel zlib-devel cyrus-sasl-devel gcc \
    krb5-client openldap2-devel libopenssl-devel\
    bind-utils bind-lib

Gentoo

Please note that the following sections assume at least an intermediate understanding of the Gentoo packaging system.

Python

Gentoo uses python-3 as the default python interpreter, but at this time Samba requires python-2 (2.4.2 or greater) The following set of commands will install and set up python-2 as the default python interpreter.

# emerge --ask --noreplace '<dev-lang/python-3'
# eselect python set python2.7
# python-updater
Kerberos

On Gentoo, you have two choices for a kerberos implementation, app-crypt/mit-krb5 and app-crypt/heimdal. Unfortunately the two implementations can not be installed at the same time. Currently, the Samba developers recommend using app-crypt/heimdal. So you must first uninstall app-crypt/mit-krb5 (if installed,) then install app-crypt/heimdal and rebuild any packages that were using the old kerberos implementation.

# emerge --unmerge --ask app-crypt/mit-krb5
# emerge --ask app-crypt/heimdal
# revdep-rebuild -- -ask
Bind

To enable automatic zone management, net-dns/bind and net-dns/bind-tools should be emerged with the USE flags for berkdb, dlz and gssapi set. To enable them permanently, add the following to /etc/package.use:

net-dns/bind berkdb dlz gssapi
net-dns/bind-tools gssapi

Then, emerge net-dns/bind:

# emerge --ask  net-dns/bind net-dns/bind-tools

Note that if you have problems with samba’s gssapi updates to bind, try using the alternate kerberos implementation of app-crypt/mit-krb5.

Samba-supplied Libraries (tdb/ldb/tevent)

There are a few Samba libraries that need to be installed, note that these packages might be keyworded as unstable, so you might need to add the following to your /etc/package.keywords:

~sys-libs/tevent-0.9.17
~sys-libs/tdb-1.2.10
~sys-libs/ldb-1.1.12
~sys-libs/talloc-2.0.7

Additionally, Samba requires sys-libs/tdb and sys-libs/talloc to be emerged with the USE flag python set. To enable this permanently, add the following to /etc/package.use:

sys-libs/tdb python
sys-libs/talloc python

Note: In new(er) installations of gentoo, the above files will be located in /etc/portage/, i.e. /etc/portage/package.keywords and /etc/portage/package.use. They may be symlinked to /etc for backward compatibility. Now, emerge the packages:

# emerge --ask '=sys-libs/talloc-2.0.7' '=sys-libs/tdb-1.2.10' '=sys-libs/tevent-0.9.17' '=sys-libs/ldb-1.1.12'

Note that ebuilds for the required versions of the above packages might not be availiable in the portage tree. In this case, check Gentoo’s Bugzilla for updated ebuilds.

Other Misc. Build/Run Dependencies

To ensure a successful Samba-4 installation, there are a few other packages that should be installed, as shown below:

# emerge --ask net-libs/gnutls sys-apps/acl dev-libs/cyrus-sasl dev-python/subunit dev-python/dnspython net-dns/libidn 

FIXME: Are dev-python/dnspython net-dns/libidn still required?

ファイルシステムサポート

Samba4の新しい機能を利用するために、 “user”及び”system” xattr名前空間を両方サポートしたファイルシステムが必要になります。

ext3/ext4 File System

もし ext3か ext4のどちらかをファイルシステムに利用しているなら、”user_xattr”,”acl”及び “barrier=1″オプションを /etc/fstab に含める必要があります。記述例:

/dev/hda3               /home                   ext3    user_xattr,acl,barrier=1     1 1

ext4を使っているなら、単純に ext3を ext4に変えてください。通常、既存の行にオプションを追加するという変更だけ必要でしょう。fstabを変更するとき、それに誤った修正をした場合システムが起動できなくなることに注意を払ってください。 barrier=1 オプションは予想外の電源断に対して tdbトランザクションが安全であることを保証します。このオプションが有効になっていないがためにいくつかのサイトで sam.ldb内の ADデータベースが壊れました。 ファイルシステムのために、カーネルもまた XATTR, SECURITY及び POSIX_ACL オプション付きでコンパイルする必要があります。ext3では、これが意味するのは(ext4の場合は 3を 4に変えてください):

  CONFIG_EXT3_FS_XATTR=y
  CONFIG_EXT3_FS_SECURITY=y
  CONFIG_EXT3_FS_POSIX_ACL=y

もし Linux 2.6 (またはそれ以降)のカーネルで CONFIG_IKCONFIG_PROCが定義されているなら、以下のコマンドでこれを確認することができます:

$ zgrep CONFIG_EXT3_FS /proc/config.gz

xattrをサポートしていないファイルシステム

もし xattrをサポートしているファイルシステムを使っていないなら、以下の行を smb.confに追加することでそれをシミュレートすることができます:

posix:eadb = /usr/local/samba/eadb.tdb

これにより、すべての追加のファイル属性(NT ACLs, DOS EAs, streams など)が、その tdbに配置されます。これは非効率でスケールしにくいですが、少なくとも最近のファイルシステムを持たないあなたに選択の余地を与えてくれます。

ファイルシステムをテストする

ファイルシステムのサポートをテストするために、 ‘attr’パッケージをインストールして、以下の 4つのコマンドを rootで実行します:

 # touch test.txt
 # setfattr -n user.test -v test test.txt
 # setfattr -n security.test -v test2 test.txt
 # getfattr -d test.txt
 # getfattr -n security.test -d test.txt

こんな出力が期待されます:

# file: test.txt
 user.test="test"
# file: test.txt
 security.test="test2"

もしどこかで “Operation not supported”エラーが出た場合、カーネルが正しく構成されていないか、ファイルシステムが正しいオプションでマウントされていないことを意味します。 もしどこかで “Operation not permitted”エラーが出た場合、おそらくそれは rootでテストできていないことを意味します。 もし posix:eadb オプションを使っているなら、この方法でのテストは必要ありません。

原文

File System Support

To use the advanced features of Samba4 you need a filesystem that supports both the “user” and “system” xattr namespaces.

ext3/ext4 File System

If you are using either ext3 or ext4 for your file system you will need to include the options “user_xattr”,”acl” and “barrier=1” in your /etc/fstab. For example:

/dev/hda3               /home                   ext3    user_xattr,acl,barrier=1     1 1

Simply change ext3 to ext4 if you are using it. Normally you will want to just modify the existing line to add those options. Please use caution when modifying your fstab as it can lead to an un-bootable system if the wrong thing is modified. The barrier=1 option ensures that tdb transactions are safe against unexpected power loss. A number of sites have corrupted their AD database in sam.ldb by not having this option enabled. You also need to compile your kernel with the XATTR, SECURITY, and POSIX_ACL options for your filesystem. For ext3 (change the 3 to a 4 for ext4) that means you need:

  CONFIG_EXT3_FS_XATTR=y
  CONFIG_EXT3_FS_SECURITY=y
  CONFIG_EXT3_FS_POSIX_ACL=y

If you are running a Linux 2.6 (or greater) kernel with CONFIG_IKCONFIG_PROC defined you can check this with the following command:

  $ zgrep CONFIG_EXT3_FS /proc/config.gz

File Systems without xattr support

If you don’t have a filesystem with xattr support, then you can simulate it by adding the following line to your smb.conf:

  posix:eadb = /usr/local/samba/eadb.tdb

that will place all extra file attributes (NT ACLs, DOS EAs, streams etc), in that tdb. It is not efficient, and doesn’t scale well, but at least it gives you a choice when you don’t have a modern filesystem.

Testing your filesystem

To test your filesystem support, install the ‘attr’ package and run the following 4 commands as root:

 # touch test.txt
 # setfattr -n user.test -v test test.txt
 # setfattr -n security.test -v test2 test.txt
 # getfattr -d test.txt
 # getfattr -n security.test -d test.txt

You should see output like this:

 # file: test.txt
 user.test="test"
 # file: test.txt
 security.test="test2"

If you get any “Operation not supported” errors then it means your kernel is not configured correctly, or your filesystem is not mounted with the right options. If you get any “Operation not permitted” errors then it probably means you didn’t try the test as root. If you are using the posix:eadb option then you don’t need to test your filesystem in this manner.

コメントは閉じられています。

return top