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” 博客
相关新闻>>
- 发表评论
-
- 最新评论 更多>>