samba升级
前提RHEL5.3 samba3.5.11
1.备份(service smb stop)
#rsync -av /etc/samba/ /etc/samba.old/
#cp /etc/init.d/smb /etc/init.d/smb.bak
检测一下原先的版本号 rpm -q samba(如果是rpm装的,不是的话用smbd -b)
2.编译安装新的源码包(samba-3.5.11)
#tar -xvf samba-3.0.37.tar.gz
#cd samba-3.5.11
# cd source3
#./autogen.sh
#./configure --prefix=/usr/local/samba
#make &&make install
#cp -v /etc/samba/*.tdb /usr/local/samba/private/
#cp -v /etc/samba/smb.conf /usr/local/samba/lib/
#rm -rfv /etc/samba/
# ./bin/smbpasswd #测试一下,
vi /etc/ld.so.conf
加入:/usr/local/samba/lib
然后运行#ldconfig
# yum remove system-config-samba (或rpm -e )
# yum remove samba
设置Samba路径
Samba默认是安装在/usr/local/samba,因此安装完成后,可能bin、sbin目录下的程序以及man无法使用。
解决办法:
a.修改/etc/profile (全局) 或者在.bash_profile,.bashrc 文件中加上对应路径(使用下面的脚本也是一个选择)
例如# vim ~/.bash_profile
PATH=$PATH:HOME/bin:/usr/local/samba/bin:/usr/local/samba/sbin
b.增加man手册
#vim /etc/man.config
MANPATH /usr/local/samba/share/man
MANPATH_MAP /usr/local/samba/bin /usr/local/samba/share/man
MANPATH_MAP /usr/local/samba/sbin /usr/local/samba/share/man
修改samba服务启动脚本
#cp /etc/init.d/smb.bak /etc/init.d/smb
Vim smb (修改脚本)
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
# used to provide SMB network services.
#
# pidfile: /usr/local/samba/var/locks/var/smbd.pid
# pidfile: /usr/local/samba/var/locks/nmbd.pid
# config: /usr/local/samba/lib/smb.conf
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 1
fi
# Avoid using root's TMPDIR
unset TMPDIR
# Source networking configuration.
. /etc/sysconfig/network
if [ -f /etc/sysconfig/samba ]; then
. /etc/sysconfig/samba
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1
# Check that smb.conf exists.
[ -f /usr/local/samba/lib/smb.conf ] || exit 6
RETVAL=0
start() {
KIND="SMB"
echo -n $"Starting $KIND services: "
daemon smbd $SMBDOPTIONS
RETVAL=$?
echo
KIND="NMB"
echo -n $"Starting $KIND services: "
daemon nmbd $NMBDOPTIONS
相关新闻>>
- 发表评论
-
- 最新评论 更多>>