首先查看脚本:
# cat /tmp/redis_before.sh
#!/bin/bash
if [ ! -d /apps/redis-3.0.0-rc5 ];then
mkdir -p /apps/redis-3.0.0-rc5
fi
# cat /tmp/redis_after.sh
#!/bin/bash
echo "
daemonize yes
pidfile /var/run/redis_6379.pid
port 6379
#bind 127.0.0.1
timeout 600
tcp-keepalive 0
loglevel notice
logfile /var/log/redis.log
databases 16 #save 3600 1
#rdbcompression yes
#dbfilename dump.rdb
dir ./ maxmemory 6gb
maxmemory-policy volatile-lru
maxmemory-samples 3 appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb #slowlog-log-slower-than 10000
#slowlog-max-len 1024 hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512 activerehashing yes
">/apps/redis-3.0.0-rc5/conf/6379.conf # cat /tmp/redis_remove.sh
#!/bin/bash
if [ -f /etc/init.d/redis ];then
rm -f /etc/init.d/redis
fi
if [ -d /apps/redis-3.0.0-rc5 ];then
rm -rf /apps/redis-3.0.0-rc5
fi
制做:
# 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"}