Commits

Audrius Kažukauskas committed 2d730ce

system/redis: Update for version 2.6.4.

Comments (0)

Files changed (5)

system/redis/doinst.sh

   fi
   # Otherwise, we leave the .new copy for the admin to consider...
 }
+
+preserve_perms() {
+  NEW="$1"
+  OLD="$(dirname $NEW)/$(basename $NEW .new)"
+  if [ -e $OLD ]; then
+    cp -a $OLD ${NEW}.incoming
+    cat $NEW > ${NEW}.incoming
+    mv ${NEW}.incoming $NEW
+  fi
+  config $NEW
+}
+
 config etc/redis.conf.new
-
+config etc/logrotate.d/redis.new
+preserve_perms etc/rc.d/rc.redis.new

system/redis/rc.redis.new

+#!/bin/sh
+#
+# Redis startup script for Slackware Linux
+
+PORT=6379
+SERV=/usr/bin/redis-server
+CLI=/usr/bin/redis-cli
+PID=/var/run/redis.pid
+CONF=/etc/redis.conf
+
+redis_start() {
+  if [ ! -r $CONF ]; then
+    echo "$CONF does not appear to exist.  Abort."
+    exit 1
+  fi
+
+  if [ -s $PID ]; then
+    echo "Redis appears to be already running?"
+    exit 1
+  fi
+
+  echo "Starting Redis server..."
+  $SERV $CONF
+}
+
+redis_stop() {
+  if [ ! -r $PID ]; then
+    echo "$PID does not exist."
+    exit 1
+  fi
+
+  echo "Stopping Redis server..."
+  $CLI -p $PORT shutdown
+}
+
+redis_restart() {
+  redis_stop
+  sleep 3
+  redis_start
+}
+
+case "$1" in
+  start)
+    redis_start
+    ;;
+  stop)
+    redis_stop
+    ;;
+  restart)
+    redis_restart
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
+esac

system/redis/redis.SlackBuild

 # Maintained as of version 2.4.7 by Audrius Kažukauskas <audrius@neutrino.lt>
 
 PRGNAM=redis
-VERSION=${VERSION:-2.6.2}
+VERSION=${VERSION:-2.6.4}
 BUILD=${BUILD:-1}
 TAG=${TAG:-_SBo}
 
 find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
 
-# Use sample config, without overwriting.
-install -D -m 644 redis.conf $PKG/etc/redis.conf.new
+# Use sample config and set some sane defaults.
+install -D -m 0644 redis.conf $PKG/etc/redis.conf.new
+sed -i \
+  -e 's|^daemonize no|daemonize yes|' \
+  -e 's|^dir \.|dir /var/lib/redis|' \
+  -e 's|^logfile stdout|logfile /var/log/redis.log|' \
+  $PKG/etc/redis.conf.new
+
+# Create data directory.
+mkdir -p $PKG/var/lib/redis
+chmod 0700 $PKG/var/lib/redis
+
+# Install init script.
+mkdir -p $PKG/etc/rc.d
+cat $CWD/rc.redis.new > $PKG/etc/rc.d/rc.redis.new
+
+# Install logrotate script.
+mkdir -p $PKG/etc/logrotate.d
+cat $CWD/redis.logrotate > $PKG/etc/logrotate.d/redis.new
 
 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
 cp -a \

system/redis/redis.info

 PRGNAM="redis"
-VERSION="2.6.2"
+VERSION="2.6.4"
 HOMEPAGE="http://redis.io/"
-DOWNLOAD="http://redis.googlecode.com/files/redis-2.6.2.tar.gz"
-MD5SUM="4f788dfb3ee86c7e864dfe537870bb5a"
+DOWNLOAD="http://redis.googlecode.com/files/redis-2.6.4.tar.gz"
+MD5SUM="06db7941a369857d603bf2dfcc0888b3"
 DOWNLOAD_x86_64=""
 MD5SUM_x86_64=""
 REQUIRES=""

system/redis/redis.logrotate

+/var/log/redis.log {
+    daily
+    rotate 7
+    copytruncate
+    delaycompress
+    compress
+    notifempty
+    missingok
+}