Browse code

Fixed db persistence,log file,grace-ful shutdown issues

Change-Id: I07034c805b59e4fe54acdcb44ea24856ae33f44f
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2835
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Priyesh Padmavilasom <ppadmavilasom@vmware.com>

smaliakkal authored on 2017/06/01 10:40:16
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+diff -ru a/redis.conf b/redis.conf
1
+--- a/redis.conf	2017-02-12 15:14:57.000000000 +0000
2
+@@ -160,7 +160,7 @@
3
+ # Specify the log file name. Also the empty string can be used to force
4
+ # Redis to log on the standard output. Note that if you use standard
5
+ # output for logging but daemonize, logs will be sent to /dev/null
6
+-logfile ""
7
++logfile "/var/log/redis/redis.log"
8
+ 
9
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
10
+ # and optionally update the other syslog parameters to suit your needs.
11
+@@ -244,7 +244,7 @@
12
+ # The Append Only File will also be created inside this directory.
13
+ #
14
+ # Note that you must specify a directory here, not a file name.
15
+-dir ./
16
++dir /var/lib/redis
17
+ 
18
+ ################################# REPLICATION #################################
19
+ 
20
+Only in b: redis-conf.patch
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	advanced key-value store
2 2
 Name:		redis
3 3
 Version:	3.2.8
4
-Release:	2%{?dist}
4
+Release:	3%{?dist}
5 5
 License:	BSD
6 6
 URL:		http://redis.io/
7 7
 Group:		Applications/Databases
... ...
@@ -9,6 +9,7 @@ Vendor:		VMware, Inc.
9 9
 Distribution:   Photon
10 10
 Source0:	http://download.redis.io/releases/%{name}-%{version}.tar.gz
11 11
 %define sha1 redis=6780d1abb66f33a97aad0edbe020403d0a15b67f
12
+Patch0:         redis-conf.patch
12 13
 BuildRequires:  gcc
13 14
 BuildRequires:  systemd
14 15
 BuildRequires:  make
... ...
@@ -20,6 +21,7 @@ Redis is an in-memory data structure store, used as database, cache and message
20 20
 
21 21
 %prep
22 22
 %setup -q
23
+%patch0 -p1
23 24
 
24 25
 %build
25 26
 make %{?_smp_mflags}
... ...
@@ -28,7 +30,8 @@ make %{?_smp_mflags}
28 28
 install -vdm 755 %{buildroot}
29 29
 make PREFIX=%{buildroot}/usr install
30 30
 install -D -m 0640 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf
31
-
31
+mkdir -p %{buildroot}/var/lib/redis
32
+mkdir -p %{buildroot}/var/log/redis
32 33
 mkdir -p %{buildroot}/usr/lib/systemd/system
33 34
 cat << EOF >>  %{buildroot}/usr/lib/systemd/system/redis.service
34 35
 [Unit]
... ...
@@ -37,7 +40,7 @@ After=network.target
37 37
 
38 38
 [Service]
39 39
 ExecStart=/usr/bin/redis-server /etc/redis.conf --daemonize no
40
-ExecStop=/usr/libexec/redis-shutdown
40
+ExecStop=/usr/bin/redis-cli shutdown
41 41
 User=redis
42 42
 Group=redis
43 43
 
... ...
@@ -68,11 +71,15 @@ exit 0
68 68
 
69 69
 %files
70 70
 %defattr(-,root,root)
71
+%dir %attr(0750, redis, redis) /var/lib/redis
72
+%dir %attr(0750, redis, redis) /var/log/redis
71 73
 %{_bindir}/*
72 74
 %{_libdir}/systemd/*
73 75
 %config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/redis.conf
74 76
 
75 77
 %changelog
78
+*	Wed May 31 2017 Siju Maliakkal <smaliakkal@vmware.com> 3.2.8-3
79
+-	Fix DB persistence,log file,grace-ful shutdown issues
76 80
 *       Tue May 16 2017 Siju Maliakkal <smaliakkal@vmware.com> 3.2.8-2
77 81
 -       Added systemd service unit
78 82
 *       Wed Apr 5 2017 Siju Maliakkal <smaliakkal@vmware.com> 3.2.8-1