首先查看脚本:
# cat /tmp/redis_before.sh #!/bin/bashif [ ! -d /apps/redis-3.0.0-rc5 ];then mkdir -p /apps/redis-3.0.0-rc5fi # cat /tmp/redis_after.sh #!/bin/bashecho "daemonize yespidfile /var/run/redis_6379.pidport 6379#bind 127.0.0.1timeout 600tcp-keepalive 0loglevel noticelogfile /var/log/redis.logdatabases 16#save 3600 1#rdbcompression yes#dbfilename dump.rdbdir ./maxmemory 6gbmaxmemory-policy volatile-lrumaxmemory-samples 3appendonly noappendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mb#slowlog-log-slower-than 10000#slowlog-max-len 1024hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-entries 512list-max-ziplist-value 64set-max-intset-entries 512activerehashing yes">/apps/redis-3.0.0-rc5/conf/6379.conf # cat /tmp/redis_remove.sh #!/bin/bashif [ -f /etc/init.d/redis ];then rm -f /etc/init.d/redisfiif [ -d /apps/redis-3.0.0-rc5 ];then rm -rf /apps/redis-3.0.0-rc5fi
制做:
# fpm -s dir -t rpm -v 3.0.0_rc5 -n redis --before-install /tmp/redis_before.sh --after-install /tmp/redis_after.sh --after-remove /tmp/redis_remove.sh -d 'libaio' /apps/redis-3.0.0-rc5/ /etc/init.d/redis no value for epoch is set, defaulting to nil {:level=>:warn}no value for epoch is set, defaulting to nil {:level=>:warn}Created package {:path=>"redis-redis_3.0.0_rc5-1.x86_64.rpm"}