阅读767 返回首页    go 阿里云 go 技术社区[云栖]


rpm打包和yum安装,以及安装后自启动

rpmbuild 可以把源文件或者二进制文件打包成rpm包,rpm包可以放到源上进行分发。

执行rpmbuild --showrc  |grep topdir,可以找到rpmbuild 执行的根目录,

如果仅仅希望给把二进制文件打包成rpm包,那么把二进制文件放到  $topdir/BUILD/ 目录下。

编写${binary}.spec

Summary: client
Name: client
Version: 0.6 
Release: 1
Vendor: company
License: commercial
Group: Applications/Internet
%description
ols client
used to collect logs from client machine
%install
mkdir -p /apsara/binary
install -m 755 binary /apsara/binary
%post
/apsara/binary --_update_address=https://10.230.201.117:8080  --check_update_interval=1 --check_point_time_out=10 --send_address=https://service.ols.inc.com --domain_socket_address=/tmp/xxxxxxxxxxxxxxxxx
%files
/apsara/binary

%install 字段指的是安装rpm包时执行的命令,

%post字段值得是安装好rpm包后执行的命令。

编写好spec文件后,执行rpmbuild -bb binary.spec

就可以得到rpm包了


最后更新:2017-04-03 22:15:39

  上一篇:go 健康心态十则
  下一篇:go eclipse+webservice开发实例