我在AIX上编译Samba的实况贴,贴上来备忘。

废话不说,进入正题。

我用的gcc版本:

bash-3.00# gcc -v

Using built-in specs.

Target: powerpc-ibm-aix6.1.0.0

Configured with: ../gcc-4.2.4/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --host=powerpc-ibm-aix6.1.0.0

Thread model: aix

gcc version 4.2.4

为了执行configure你可能需要在你的AIX上安装一些prerequirese ,这个就不说了,你执行configure由于缺少prerequirese 失败的话,会提示的,跟着安就好了。

注意PATH里面不要包括/usr/ucb,如果包含的话,会提示说后继操作可能会报错。

如果你的PATH里面有/usr/local/bin和/opt/freeware/bin等自己的路径,注意把他们放到系统原有path的后面而不是前面,避免和系统的冲突,即这样:

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

而不是:export PATH=/usr/local/bin:$PATH

我用的是:/usr/bin:/etc:/usr/sbin:/usr/bin/X11:/sbin:/usr/java5/jre/bin:/usr/java5/bin:/usr/local/bin:/opt/freeware/bin

进入source3 (3.x的代码)

./configure --prefix=/usr/local/samba3 --with-static-modules=MODULES

然后你make,咦!报错!

嘿嘿,原来是你需要这样:

make -d -f Makefile-noincludes

然后继续make,结果报:

Linking non-shared library bin/libsmbclient.a

make: Cannot find a rule to create target EXTRA_FLAGS from dependencies.

我晕~~~

然后N久N久的googlebaidu中…..纠结痛苦……

终于找到一老外牛人在solaris下编译samba的帖子(原帖地址:http://panoramicsolution.com/blog/?p=134),参照他的帖子,

根据他的参数,我修改了下下,就是×××的部分,如下:

./configure --with-automount --without-ldap --enable-socket-wrapper \

--with-quotas --with-sys-quotas --with-acl-support --with-aio-support \

--with-pam --enable-static –prefix=/usr/local/samba3

。。。。。。。。

终于……哇!成功啦!!!!!O(∩_∩)O哈哈~

然后根据帖子,又修改了Makefile-noincludes修改同时,我一不做二不休,把Makefile-noincludes里面的EXTRA_FLAGS一行也大刀砍去,哼!叫你找不到规则!

就是把这行:

$(LIBSMBCLIENT_THREAD_OBJ) ../nsswitch/wins.o ../nsswitch/winbind_nss_linux.o: EXTRA_FLAGS := $(PTHREAD_CFLAGS)

注释掉即可。

现在Make,哈哈,成功!!!

接着乘胜追击,make install下下~~

成功~~~

可是,你注定会发现居然install后的安装目录里面竟然没有smbd和nmbd!

然后你就又不得不看下Makefile里面的install一节,发现个一劳永逸的办法,那就是要重新install,用:make install-everything

O(∩_∩)O哈哈~

你install完成后,结果直接执行smbd,惊奇地发现:怎么还是没有smbd和nmbd!

我晕~~哈哈,你再执行make installbin想单独安装bin文件,

结果发现安装日志里面写了安装所有bin目录下的程序,可就是没有安装smbd和nmbd,晕死!

唉,算了,目前我就是手动copy 的~~晕J哈哈

好了,现在执行testparm测试下下。

报错:

Load smb config files from /usr/local/samba3/lib/smb.conf

rlimit_max: rlimit_max (2000) below minimum Windows limit (16384)

params.c:OpenConfFile() - Unable to open configuration file "/usr/local/samba3/lib/smb.conf":

No such file or directory

Error loading services.

此时,需要将源码包里的./examples/smb.conf.default复制到/usr/local/samba3/lib/smb.conf。

再执行testparm:

报错:

Could not load program /usr/local/samba3/bin/testparm:

Dependent module libwbclient.so could not be loaded.

Could not load module libwbclient.so.

System error: No such file or directory

明显没有找到库嘛,把/usr/local/samba3/lib/:/opt/freeware/lib加到了LD_LIBRARY_PATH里面,分别放入/.dtprofile和/etc/profile,随便对这两个文件中的某个执行下source,

重新testparm,成功O(∩_∩)O~:

Load smb config files from /usr/local/samba3/lib/smb.conf

rlimit_max: rlimit_max (2000) below minimum Windows limit (16384)

Processing section "[homes]"

Processing section "[printers]"

Loaded services file OK.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

只是发现有个小小的瑕疵:

rlimit_max: rlimit_max (2000) below minimum Windows limit (16384)

原来是系统限制了open file的数量,小小地修改之:

ulimit –n 20000 (最好写入/etc/security/limits文件)

搞定!

注意:

1. 貌似,两个AIX在同一网段,用的后面的“要求输入用户名和密码的samba配置文件”的配置文件,那么,需要确保他们的workgroup是不一样,否则samba从windows上映射网络驱动器会有问题,提示:同一个用户不能用一个以上的用户名连接服务器。

要求输入用户名和密码的samba配置文件:

[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH

workgroup = NEWGROUP

# server string is the equivalent of the NT Description field

server string = AIX 108.71 Samba Server

# Security mode. Defines in which mode Samba will operate. Possible

# values are share, user, server, domain and ads. Most people will want

# user level security. See the Samba-HOWTO-Collection for details.

security = user

netbios name = aix71

# If you want to automatically load your printer list rather

# than setting them up individually then you'll need this

load printers = yes

# this tells Samba to use a separate log file for each machine

# that connects

log file = /usr/local/samba/var/log.%m

# Put a capping on the size of the log files (in Kb).

max log size = 50

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names

# via DNS nslookups. The default is NO.

dns proxy = no

#============================ Share Definitions ==============================

[homes]

comment = Home Directories

browseable = no

writable = yes

# NOTE: If you have a BSD-style print system there is no need to

# specifically define each individual printer

[printers]

comment = All Printers

path = /usr/spool/samba

browseable = no

# Set public = yes to allow user 'guest account' to print

guest ok = no

writable = no

printable = yes

[brant]

;   comment = Mary's and Fred's stuff

path = /

valid users =  root

public = yes

writable = yes

browseable = yes

;   printable = no

;   create mask = 0765

如果不要输入密码,把security改为share即可。

转载于:https://blog.51cto.com/brantc/436144

在AIX上编译Samba相关推荐

  1. c 远程编辑linux文件,makefile - 在远程Linux机器上编译C ++ - “检测到时钟偏差”警告...

    makefile - 在远程Linux机器上编译C ++ - "检测到时钟偏差"警告 我通过PuTTY和WinSCP连接到我大学的小型Linux集群,使用后者传输文件,并使用前者编 ...

  2. 最大化 AIX 上的 Java 性能,第 3 部分: 更多就是更好

    http://www.ibm.com/developerworks/cn/aix/library/es-Javaperf/es-Javaperf3.html 最大化 AIX 上的 Java 性能,第 ...

  3. 内存详解mdash;mdash;理解 JVM 如何使用 AIX 上的本机内存

    理解 JVM 如何使用 AIX 上的本机内存 Java™ 堆耗尽并不是造成 java.lang.OutOfMemoryError 的惟一原因.如果本机内存 耗尽,则会发生普通调试技巧无法解决的 Out ...

  4. oracle 11.2.0.4 bug,警示:一个专为AIX上oracle11.2.0.4版本定制的Bug正在高发

    作者:盖国强 有这么一个Bug,仅在AIX平台上,Oracle Database 11.2.0.4的版本中出现,在12.1中被修复,之前和之后都不存在,所以简直是为这一版本定制的. 之前一些客户零星的 ...

  5. 在Ubuntu 14.04 64bit上编译安装Crtmpserver trunk svn 811版本!

    这里仅在 在Ubuntu 12.04 64bit上搭建Crtmpserver视频点播服务 基础上补充一下在Ubuntu 14.04上编译安装Crtmpserver的方法,以作备忘.因为Ubuntu 1 ...

  6. Ubuntu14.04上编译指定版本的protobuf源码操作步骤

    Google Protobuf的介绍可以参考 http://blog.csdn.net/fengbingchun/article/details/49977903 ,这里介绍在Ubuntu14.04上 ...

  7. RH系列linux上编译android2.3(gingerbread)

    在RH系列linux上编译android2.3(gingerbread)的过程如下: 官方源码及ubuntu编译过程在(http://source.android.com/source/index.h ...

  8. 64位Ubuntu上编译32位程序

    1.确认主机为64位架构的内核,应该输出为adm64,执行: $ dpkg --print-architecture 2.确认打开了多支架功能,应该输出为i386,执行: $ dpkg --print ...

  9. 在CentOS/Debian/Ubuntu上编译安装最新版 GCC 8 , cmake 3 和ninja

    CentOS不像Debian/Ubuntu,不能直接从官方库中安装最新版的gcc/g++,只能源码编译安装. gcc下载地址:Index of /gnu/gcc 我选择了最新版本 gcc-8.3.0, ...

最新文章

  1. OpenCV findContours和drawContours用法的实例(附完整代码)
  2. 学习分享会(2019.5.31)
  3. oracle常见单词_Oracle中常见的英语单词
  4. 【词向量】从Word2Vec到Bert,聊聊词向量的前世今生(一)
  5. [译] Architecture Components 之 Adding Components to your Project
  6. java之public class和class声明区别详解 (转)
  7. [转载]树、森林和二叉树的转换
  8. docker的安装与加速器的配置
  9. SQL AZURE数据库创建,云计算体验之一
  10. 一图全解10个影响人类社会的算法
  11. 基于thinkphp的出租屋管理系统
  12. 管网平差c语言编程,给水管网平差计算步骤
  13. android 混淆 minifyEnabled
  14. mysql按照音序排列_如何按音序排列
  15. c语言的32位指针加1是多少,c语言中,指针加1的情况.指针变量详细介绍
  16. Linux中部分命令英语全拼
  17. linux 能打开exe文件,linux能运行exe文件吗
  18. 单片机基础:详解独立按键实现单击、双击、长按
  19. Centos7.1安装CUDA7.0
  20. 基于RSocket协议实现客户端与服务端通信

热门文章

  1. Django学习笔记《一》图书管理系统项目挂载到阿里云
  2. 交叉编译openssl不修改Makefile的方法
  3. C++ 类的const成员函数
  4. windows环境下C语言socket编程
  5. 【C++ Primer | 16】容器适配器全特化、偏特化
  6. linux 函数手册 在线,Linux系统API函数手册
  7. 【安富莱二代示波器教程】第8章 示波器设计—测量功能
  8. 用solidity语言开发代币智能合约
  9. UOJ #150 【NOIP2015】 运输计划
  10. 多维DP UVA 11552 Fewest Flop