Solaris 11で適当にSamba 4.6をビルドする
Solaris 11にSamba 4.6.7をビルドしてインストールします。Source tarball からコンパイルしますが、なるべく手間のかからない感じで雑にいきます
手順
- Samba 4.6.7 の Source tarball をダウンロードし、適当なディレクトリに展開します。
- ./configure を実行
ヘッダつきのgnutlsがpkgに見つからなかったので、gnutlsを必要とする ADDC Feature (Active Directory Domain Controller) を無効化してビルドします$ ./configure --disable-gnutls --without-ad-dc
- パッチ当て
素の状態でgmakeすると、以下のエラーを吐いてビルドが止まります:../source3/lib/messages_dgm.c: In function 'messaging_dgm_sendmsg': ../source3/lib/messages_dgm.c:363:30: error: 'MSG_NOSIGNAL' undeclared (first use in this function)
Solaris10以降でSamba 4.6系をビルドする場合、ソースの修正が必要です (https://bugzilla.samba.org/show_bug.cgi?id=12502)
Bugzilla の attachment から適当にpatchを起こします$ cat > messages_dgm.c.patch
--- source3/lib/messages_dgm.c 2017-01-11 16:55:15.000000000 +0900
+++ source3/lib/patched.messages_dgm.c 2017-08-11 23:57:43.109329540 +0900
@@ -337,6 +337,12 @@ static ssize_t messaging_dgm_sendmsg(int
{
struct msghdr msg;
ssize_t fdlen, ret;
+ int flags = 0;
+
+#ifdef MSG_NOSIGNAL
+ flags = MSG_NOSIGNAL;
+#endif
+
/*
* Do the actual sendmsg syscall. This will be called from a
@@ -360,7 +366,7 @@ static ssize_t messaging_dgm_sendmsg(int
msghdr_prep_fds(&msg, buf, fdlen, fds, num_fds);
do {
- ret = sendmsg(sock, &msg, MSG_NOSIGNAL);
+ ret = sendmsg(sock, &msg, flags);
} while ((ret == -1) && (errno == EINTR));
}
[Ctrl+D]$ gpatch -p0 < messages_dgm.c.patch
- ビルド
$ env MAKE=gmake gmake
- インストール
$ sudo gmake install
- SMFに登録
ここ (https://solarisrants.wordpress.com/2014/06/10/samba-4-on-solaris-11/) の "Starting and stopping using SMF" を参考にするといい感じ - お好きに /usr/local/etc/smb.conf を書いておしまい