标签:概念 get move amp auto ESS group evel mod
FPM功能简单说就是将一种类型的包转换成另一种类型
类型 | 说明 |
dir?? | 将目录打包成所需要的类型,可以用于源码编译安装的软件包 |
rpm?? | 对rpm进行转换 |
gem?? | 对rubygem包进行转换 |
python | 将python模块打包成相应的类型 |
类型 | 说明 |
rpm??? | 转换为rpm包 |
deb??? | 转换为deb包 |
solaris | 转换为solaris包 |
puppet | 转换为puppet模块 |
fpm是ruby写的,因此系统环境需要ruby,且ruby版本号大于1.8.5
[root@zabbix SOURCES] # yum -y install ruby rubygems ruby-devel
[root@zabbix SOURCES] # [root@test ~]# rpm -qa ruby rubygems ruby-devel
[root@zabbix SOURCES] # gem sources list
*** CURRENT SOURCES ***
?
[root@zabbix SOURCES] # gem sources -a http://mirrors.aliyun.com/rubygems/
[root@zabbix SOURCES] # gem install json -v 1.8.3
[root@zabbix SOURCES] # gem install fpm -v 1.3.3
注意:如果是centos7,可以使用gem install fpm
[root@zabbix sbin] # wget http://nginx.org/download/nginx-1.16.1.tar.gz
[root@zabbix SOURCES] # yum install -y pcre-devel openssl-devel
[root@zabbix tools] # tar xf nginx-1.16.1.tar.gz
[root@zabbix tools] # cd nginx-1.16.1/
[root@zabbix nginx-1.16.1] # ./configure --prefix=/application/nginx-1.16.1 --with-http_ssl_module --with-http_stub_status_module
[root@zabbix nginx-1.16.1] # make && make install
[root@zabbix nginx-1.16.1] # ln -s /application/nginx-1.16.1 /application/nginx
[root@zabbix scripts] # cat /server/scripts/nginx_post_install.sh
#!/bin/bash
useradd nginx -M -s /sbin/nologin
ln -s /application/nginx/sbin/* /usr/local/sbin/
ln -sf /application/nginx-1.16.1 /application/nginx
[root@zabbix scripts] #
[root@zabbix scripts] # fpm -s dir -t rpm -n nginx -v 1.16.1 -d ‘pcre-devel,openssl-devel‘ --post-install /server/scripts/nginx_post_install.sh -f /application/nginx-1.16.1/
参数 | 参数说明 |
-s | 指定源类型 |
-t | 指定目标类型,即想要制作为什么包 |
-n | 指定包的名字 |
-v | 指定包的版本号 |
-C | 指定打包的相对路径? |
-d | 指定依赖于哪些包 |
-f | 第二次打包时目录下如果有同名安装包存在,则覆盖它 |
-p | 输出的安装包的目录,不想放在当前目录下就需要指定 |
--post-install? | 软件包安装完成之后所要运行的脚本;同--after-install |
--pre-install?? | 软件包安装完成之前所要运行的脚本;同--before-install |
--post-uninstall | 软件包卸载完成之后所要运行的脚本;同--after-remove |
--pre-uninstall | 软件包卸载完成之前所要运行的脚本;同--before-remove |
[root@zabbix scripts] # scp -r nginx-1.16.1-1.x86_64.rpm 172.16.1.51:/root/
[root@db ~] # nginx -V????????????????????发现没有nginx服务
-bash: /usr/local/sbin/nginx: No such file or directory
[root@db ~] #
[root@db ~] # yum -y install nginx-1.16.1-1.x86_64.rpm
[root@db ~] # nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/application/nginx-1.16.1 --with-http_ssl_module --with-http_stub_status_module
[root@db ~] # /application/nginx/sbin/nginx
[root@db ~] # ps -ef | grep nginx
root 6219 1 0 22:27 ? 00:00:00 nginx: master process /application/nginx/sbin/nginx
nobody 6220 6219 0 22:27 ? 00:00:00 nginx: worker process
root 6222 5047 0 22:27 pts/1 00:00:00 grep --color=auto nginx
[root@db ~] # rpm2cpio nginx-1.16.1-1.x86_64.rpm | cpio -div
./application/nginx-1.16.1/conf/fastcgi.conf
./application/nginx-1.16.1/conf/fastcgi.conf.default
./application/nginx-1.16.1/conf/fastcgi_params
./application/nginx-1.16.1/conf/fastcgi_params.default
./application/nginx-1.16.1/conf/koi-utf
./application/nginx-1.16.1/conf/koi-win
./application/nginx-1.16.1/conf/mime.types
./application/nginx-1.16.1/conf/mime.types.default
./application/nginx-1.16.1/conf/nginx.conf
./application/nginx-1.16.1/conf/nginx.conf.default
./application/nginx-1.16.1/conf/scgi_params
./application/nginx-1.16.1/conf/scgi_params.default
./application/nginx-1.16.1/conf/uwsgi_params
./application/nginx-1.16.1/conf/uwsgi_params.default
./application/nginx-1.16.1/conf/win-utf
./application/nginx-1.16.1/html/50x.html
./application/nginx-1.16.1/html/index.html
./application/nginx-1.16.1/logs
./application/nginx-1.16.1/sbin/nginx
11643 blocks
标签:概念 get move amp auto ESS group evel mod
原文地址:https://www.cnblogs.com/liangyuxing/p/12046428.html