summaryrefslogtreecommitdiff
path: root/community/redis
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-08-06 01:53:55 -0700
committerroot <root@rshg054.dnsready.net>2013-08-06 01:53:55 -0700
commita2fb8ff517d83749ec3b5543aeba805f07ea257d (patch)
tree87eac8f03f062c2c5ab3ff3dd92e04c07fb4e896 /community/redis
parentb3923b26c3d37257246fea13bdb1151c96cb2fe4 (diff)
Tue Aug 6 01:53:08 PDT 2013
Diffstat (limited to 'community/redis')
-rw-r--r--community/redis/PKGBUILD21
-rw-r--r--community/redis/redis.install14
-rw-r--r--community/redis/redis.service3
-rw-r--r--community/redis/redis.tmpfiles.d1
4 files changed, 32 insertions, 7 deletions
diff --git a/community/redis/PKGBUILD b/community/redis/PKGBUILD
index f4c813590..34b769bce 100644
--- a/community/redis/PKGBUILD
+++ b/community/redis/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 92955 2013-06-20 12:43:06Z spupykin $
+# $Id: PKGBUILD 95069 2013-08-05 10:49:57Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Jan-Erik Rediger <badboy at archlinux dot us>
# Contributor: nofxx <x@<nick>.com>
pkgname=redis
pkgver=2.6.14
-pkgrel=1
+pkgrel=2
pkgdesc="Advanced key-value store"
arch=('i686' 'x86_64')
url="http://redis.io/"
@@ -14,17 +14,25 @@ depends=('bash')
makedepends=('gcc>=3.1' 'make' 'pkgconfig')
backup=("etc/redis.conf"
"etc/logrotate.d/redis")
+install=redis.install
source=("http://redis.googlecode.com/files/${pkgname}-${pkgver}.tar.gz"
"redis.service"
- "redis.logrotate")
+ "redis.logrotate"
+ "redis.tmpfiles.d")
md5sums=('02e0c06e953413017ff64862953e2756'
- '5ab9fdb200e15c13b450fda77fa030b6'
- '9e2d75b7a9dc421122d673fe520ef17f')
+ '5320aa6d0f31aadc1d6202ca40425aea'
+ '9e2d75b7a9dc421122d673fe520ef17f'
+ 'dd9ab8022b4d963b2e5899170dfff490')
+
+prepare() {
+ cd "$srcdir/${pkgname}-${pkgver}"
+ sed -i 's|# bind 127.0.0.1|bind 127.0.0.1|' redis.conf
+ sed -i 's|pidfile .*|pidfile /run/redis/redis.pid|' redis.conf
+}
build() {
cd "$srcdir/${pkgname}-${pkgver}"
make MALLOC=libc
- sed -i 's|# bind 127.0.0.1|bind 127.0.0.1|' redis.conf
}
package() {
@@ -37,4 +45,5 @@ package() {
install -Dm644 "$srcdir/redis.logrotate" "$pkgdir/etc/logrotate.d/redis"
sed -i 's|daemonize no|daemonize yes|;s|dir \./|dir /var/lib/redis/|;s|logfile stdout|logfile /var/log/redis.log| ' $srcdir/${pkgname}-${pkgver}/redis.conf
install -D -m644 "$srcdir/${pkgname}-${pkgver}/redis.conf" "$pkgdir/etc/redis.conf"
+ install -Dm644 "$srcdir/redis.tmpfiles.d" "$pkgdir/usr/lib/tmpfiles.d/redis.conf"
}
diff --git a/community/redis/redis.install b/community/redis/redis.install
new file mode 100644
index 000000000..058a68f80
--- /dev/null
+++ b/community/redis/redis.install
@@ -0,0 +1,14 @@
+post_install() {
+ grep -E "^redis:" etc/group >/dev/null || groupadd --system redis
+ grep -E "^redis:" etc/passwd >/dev/null || useradd --system -g redis -d /var/lib/redis -s /bin/false redis
+ touch var/log/redis.log
+ chown redis:redis var/log/redis.log
+ systemd-tmpfiles --create redis.conf
+ install -dm0700 var/lib/redis
+ chown -R redis:redis var/lib/redis
+}
+
+post_upgrade() {
+ post_install
+ echo "Redis starts from redis user by default. Check redis.service file"
+}
diff --git a/community/redis/redis.service b/community/redis/redis.service
index 7596b4bda..bb364f749 100644
--- a/community/redis/redis.service
+++ b/community/redis/redis.service
@@ -4,7 +4,8 @@ After=network.target
[Service]
Type=forking
-PIDFile=/run/redis.pid
+User=redis
+PIDFile=/run/redis/redis.pid
ExecStartPre=/bin/mkdir -p /var/lib/redis
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/usr/bin/redis-cli shutdown
diff --git a/community/redis/redis.tmpfiles.d b/community/redis/redis.tmpfiles.d
new file mode 100644
index 000000000..773b8eac4
--- /dev/null
+++ b/community/redis/redis.tmpfiles.d
@@ -0,0 +1 @@
+d /run/redis 0755 redis redis -