samba升级(2)

来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:40 点击:

RETVAL2=$?
echo
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /usr/local/samba/var/locks/smbd.pid || \
   RETVAL=1
return $RETVAL
}
stop() {
        KIND="SMB"
echo -n $"Shutting down $KIND services: "
killproc smbd
RETVAL=$?
echo
KIND="NMB"
echo -n $"Shutting down $KIND services: "
killproc nmbd
RETVAL2=$?
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /usr/local/samba/var/locks/smbd.pid
echo ""
return $RETVAL
}
restart() {
stop
start
}
reload() {
        echo -n $"Reloading smb.conf file: "
killproc smbd -HUP
RETVAL=$?
echo
return $RETVAL
}
rhstatus() {
status smbd
RETVAL=$?
status nmbd
RETVAL2=$?
if [ $RETVAL -ne 0 ] ; then
return $RETVAL
fi
if [ $RETVAL2 -ne 0 ] ; then
return $RETVAL2
fi
}
# Allow status as non-root.
if [ "$1" = status ]; then
       rhstatus
       exit $?
fi
# Check that we can write to it... so non-root users stop here
[ -w /usr/local/samba/lib/smb.conf ] || exit 4
case "$1" in
  start)
   start
;;
  stop)
   stop
;;
  restart)
   restart
;;
  reload)
   reload
;;
  status)
   rhstatus
;;
  *)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 2
esac
exit $?
加入服务 Chkconfig --add smb
修改bin的路径
 #!/bin/bash
for bin in `ls -1 /usr/local/samba/bin`
do
cp -bv /usr/local/samba/bin/$bin /usr/bin/
done

for sbin in `ls -1 /usr/local/samba/sbin`
do
cp -bv -s /usr/local/samba/sbin/$sbin /usr/sbin/
done

exit 0
此时
可以启动samba了
   Service smb start


本文出自 “Mylinux” 博客

发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • /etc/fstab 详解
  • nginx主主集群
  •  LVS-NAT和LVS-DR模式的实现详解
  •  RHCE考试之磁盘配额
  • 学习笔记:ACL详解
  • suse linux双网卡双网关配置
  •  LVM逻辑卷管理器
  •  Nginx主主负载均衡架构
  • ubuntu学习Mysql

快速直达

操作系统导航

LinuxWindows虚拟机
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1