0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

RockyLinux-Sambaソースビルドメモ

Posted at

CentOSサポート終了につき、後継に当たるRockyLinuxでSambaをソースからビルドした手順を記載する。confファイル等については、割愛。

参考サイト

Build Samba from Source - SambaWiki (https://wiki.samba.org/index.php/Build_Samba_from_Source)
Sambaのビルド手順 - Qiita(https://qiita.com/vmmhypervisor/items/4918b3a2767cf38b3754)

構築環境

OS:Rocky Linux release 8.4 (Green Obsidian)
Sambaバージョン:4.14.6 (2021/08現在最新)
※なお、Rocky Linux インストール時にGroup Installで"Base"、"Development tools"をインストール済みである。

Sambaビルド手順

依存パッケージ入手

Package Dependencies Required to Build Samba(https://wiki.samba.org/index.php/Package_Dependencies_Required_to_Build_Samba) を参考に、ビルドに必要なパッケージを取得するため、リポジトリ登録から行う。

リポジトリ設定

【参考】

DNF plugins packageインストール

# dnf install dnf-plugins-core

EPELインストール&有効

# dnf install epel-release

AppStream,PowerTools,EPELリポジトリを有効

# dnf config-manager --set-enabled appstream
# dnf config-manager --set-enabled powertools
# dnf config-manager --set-enabled epel

依存パッケージインストール

# dnf install docbook-style-xsl gcc gdb gnutls-devel gpgme-devel \
	jansson-devel keyutils-libs-devel krb5-workstation libacl-devel \
	libaio-devel libarchive-devel libattr-devel libblkid-devel libtasn1 \
	libtasn1-tools libxml2-devel libxslt lmdb-devel openldap-devel pam-devel \
	perl perl-ExtUtils-MakeMaker perl-Parse-Yapp popt-devel python3-cryptography \
	python3-dns python3-gpg python36-devel readline-devel rpcgen systemd-devel \
	tar zlib-devel

Samba安定バージョンソース入手&解凍

https://download.samba.org/pub/samba/
よりSambaのソースを取得する。

最新バージョンを手に入れたい場合

# wget https://download.samba.org/pub/samba/samba-latest.tar.gz
# tar -zxf samba-latest.tar.gz

バージョンを直に指定する場合

# wget https://download.samba.org/pub/samba/stable/samba-x.y.z.tar.gz
# tar -zxf samba-x.y.z.tar.gz

configure 構成、設定

# cd samba-x.y.z/
# ./configure

configure途中でエラーがでなく、以下メッセージが出ればOK

'configure' finished successfully (50.839s)

configure の途中、以下エラーが出力された場合

Unable to find Python module 'markdown'. Please install the system package: python3-markdown'.

python3-markdownパッケージをインストールし再configure

# dnf install python3-markdown

vfs_snapper is enabled but prerequisite dbus-1 package not found. Use --with-shared-modules='!vfs_snapper' to disable vfs_snapper support.

以下ページを参考に、dbus-develをインストール

# dnf install dbus-devel

その他Configureオプション指定をしたい場合

configure helpを参照

# ./configure --help

例:AD/DC機能無し、かつインストール先を指定したい場合

# ./configure --without-ad-dc --prefix=【Sambaインストール先ディレクトリ】

makeコンパイル

configure 後、make コンパイルを開始する。
通常makeコマンドのみでよいが、以下makeコマンドで複数ジョブを並行して実行する。

# make -j 2

コンパイルがエラーなしで終了し、以下メッセージが出ればOK

Waf: Leaving directory `【ソース保存先】/bin/default'
'build' finished successfully (6m6.245s)

makeインストール

makeインストールへ進む

# make install

インストールがエラーなしで終了し、以下メッセージが出ればOK

Waf: Leaving directory `【ソース保存先】/bin/default'
'install' finished successfully (3m22.639s)

環境パス設定

必要に応じて、.bash_profileへ設定

export PATH=/usr/local/samba/bin/:/usr/local/samba/sbin/:$PATH

prefixでインストール先を変更している場合、ディレクトリパスを間違えないこと。

Samba(smbd)起動

以下デーモンモードで起動。ログ上にエラーがでなければOK。

# smbd -D

Sambaのアップグレード

ソース入手から、makeインストールまでおなじ手順を実施すること。
(未確認であるため、最新バージョンがリリースされたら確認)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?