(脚本还未测试运行,仅为手动安装过程的总结)


因由:centos6.2运行原centos5的func安装脚本出错,原centos5搭配的func版本为0.25
1.service funcd start报funcd dead but pid file exist
2.service funcd start无报错,但无进程,端口也没起来
怀疑
1.python版本:centos6.2自带python2.6.6,原centos5的func安装脚本又安装了python2.5.1
  直接yum -y install func/certmaster 报英文:当前python为2.6,支持版本为2.4
  后来查相关资料,与python版本无关
2.找另一台测试机,直接安装func/certmaster0.28版
  pyOpenSSL无法python setup.py install安装
  改为直接yum -y install pyOpenSSL-0.10
  安装成功,启动不出错
问题解决
线上服务器直接安装0.28func/certmaster,问题解决
会是func版本问题吗?
安装脚本ins_func_centos6.sh
#!/bin/sh
#a scripts to install func 0.28 in CentOS 6.2
#zhangmig@gmail.com
#2012-03-31

if [ -d "/home/install/func" ];then
echo "func had been install in this server"
fi

mkdir -p /home/install/func
cd /home/install/func
_pwd=`pwd`
_url="http://soft_download_url"

#Install gdbm/gdbm-devel
ins_status=`rpm -qa|grep gdbm|wc -l`
if [ $ins_status -lt "2" ];then
yum -y install gdbm gdbm-devel
fi
#检查gdbm包,未检查到2个包就安装,这个判断感觉不成熟

#Install pyOpenSSL
yum -y install pyOpenSSL-0.10

#Install func
wget $_url/func_centos6/certmaster-0.28.tar.gz
tar zxvf certmaster-0.28.tar.gz
cd certmaster-0.28
/usr/bin/python setup.py install

cd $_pwd
wget $_url/func_centos6/func-0.28.tar.gz
tar zxvf func-0.28.tar.gz
cd func-0.28
/usr/bin/python setup.py install

#Custom configure file
sed -i 's/'`hostname`'//g' /etc/hosts
cd /etc/certmaster
wget -N $_url/func/certmaster.conf
wget -N $_url/func/minion.conf

cd /etc/func
sed -i -e '/^listen_port/{ s/51234/109/; }' minion.conf
#自定义func监听端口为109

sed -i "s/^minion_name/#minion_name/g" minion.conf
echo "minion_name = `hostname`" >> minion.conf

/sbin/chkconfig --level 345 funcd on
/sbin/chkconfig --level 345 certmaster on
/sbin/service funcd start
/sbin/service certmaster start

echo "========================"
echo "====install complete===="
echo "========================"