Hello community, here is the log from the commit of package redis for openSUSE:Factory checked in at 2018-09-11 17:15:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/redis (Old) and /work/SRC/openSUSE:Factory/.redis.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "redis" Tue Sep 11 17:15:47 2018 rev:45 rq:634217 version:4.0.11 Changes: -------- --- /work/SRC/openSUSE:Factory/redis/redis.changes 2018-08-18 00:05:55.547402670 +0200 +++ /work/SRC/openSUSE:Factory/.redis.new/redis.changes 2018-09-11 17:15:58.563532052 +0200 @@ -1,0 +2,55 @@ +Fri Sep 7 12:03:31 UTC 2018 - Marcus Rueckert <[email protected]> + +- make sure that disabling/restarting servers works + + https://nordisch.org/posts/hooking-up-instantiated-services-with-rpm/ + +------------------------------------------------------------------- +Thu Sep 6 19:03:06 UTC 2018 - Marcus Rueckert <[email protected]> + +- make check && true -> make check || true + This was probably meant to catch an error in the test suite, but + with && it would only return true if it would return true + already. + +------------------------------------------------------------------- +Thu Sep 6 17:01:14 UTC 2018 - Marcus Rueckert <[email protected]> + +- added systemd unit file file redis-sentinel + - the unit file uses the same multiple instance mechanism as the + normal redis unit file + + systemctl start redis-sentinel@default will look for + + /etc/redis/sentinel-default.conf + + and expects a pid file + + /var/run/redis/sentinel-default.pid + + Please make sure your sentinel config sets the pid file. + + - adapted the default sentinel.conf.example to set the pid file + and the log file similar to the normal redis.conf: + /var/log/redis/sentinel-<instancename>.log + /var/run/redis/sentinel-<instancename>.pid + + The unit file checks for the pid file so please adapt your + local sentinel configs. + + Changed: redis-conf.patch + - adapt and restructure README.SUSE + - move the LimitNoFile to the service file itself so the user + do not have to manually do that step for every instance + - move the apache integration into its own section + - add section for redis-sentinel + - install sentinel example config with group write permissions + to indicate that the actually config needs to be writable. + +------------------------------------------------------------------- +Thu Sep 6 15:08:28 UTC 2018 - Marcus Rueckert <[email protected]> + +- replace some duplicate binaries with symlinks similar to what the + fedora package does + +------------------------------------------------------------------- New: ---- redis-sentinel.target [email protected] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ redis.spec ++++++ --- /var/tmp/diff_new_pack.RZDRnU/_old 2018-09-11 17:16:03.691524158 +0200 +++ /var/tmp/diff_new_pack.RZDRnU/_new 2018-09-11 17:16:03.691524158 +0200 @@ -12,12 +12,14 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %define _data_dir %{_localstatedir}/lib/%{name} %define _log_dir %{_localstatedir}/log/%{name} %define _conf_dir %{_sysconfdir}/%{name} + Name: redis Version: 4.0.11 Release: 0 @@ -32,6 +34,8 @@ Source4: %{name}.tmpfiles.d Source5: README.SUSE Source6: %{name}.sysctl +Source7: %{name}[email protected] +Source8: %{name}-sentinel.target # PATCH-FIX-OPENSUSE -- openSUSE-style init script Patch0: %{name}-initscript.patch # PATCH-MISSING-TAG -- See https://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines @@ -72,6 +76,7 @@ %install install -m 0750 -d \ + %{buildroot}%{_sbindir} \ %{buildroot}%{_log_dir} \ %{buildroot}%{_data_dir} \ %{buildroot}%{_conf_dir} \ @@ -80,15 +85,19 @@ install -Dpm 0755 src/%{name}-benchmark %{buildroot}%{_bindir}/%{name}-benchmark install -Dpm 0755 src/%{name}-cli %{buildroot}%{_bindir}/%{name}-cli -install -Dpm 0755 src/%{name}-check-aof %{buildroot}%{_bindir}/%{name}-check-aof -install -Dpm 0755 src/%{name}-check-rdb %{buildroot}%{_bindir}/%{name}-check-rdb install -Dpm 0755 src/%{name}-trib.rb %{buildroot}%{_bindir}/%{name}-trib.rb + install -Dpm 0755 src/%{name}-server %{buildroot}%{_sbindir}/%{name}-server -ln -sfv redis-server %{buildroot}%{_sbindir}/%{name}-sentinel + +ln -sfv ../sbin/redis-server %{buildroot}%{_bindir}/%{name}-check-aof +ln -sfv ../sbin/redis-server %{buildroot}%{_bindir}/%{name}-check-rdb +ln -sfv ../sbin/redis-server %{buildroot}%{_sbindir}/%{name}-check-aof +ln -sfv ../sbin/redis-server %{buildroot}%{_sbindir}/%{name}-check-rdb +ln -sfv ../sbin/redis-server %{buildroot}%{_sbindir}/%{name}-sentinel perl -p -i -e 's|daemonize yes|daemonize no|g' %{name}.conf install -Dm 0640 redis.conf %{buildroot}%{_conf_dir}/default.conf.example -install -Dm 0640 sentinel.conf %{buildroot}%{_conf_dir}/sentinel.conf.example +install -Dm 0660 sentinel.conf %{buildroot}%{_conf_dir}/sentinel.conf.example # some sysctl stuff install -Dm 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysctl.d/00-%{name}.conf @@ -96,6 +105,9 @@ install -Dm 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.target install -Dm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}@.service install -Dm 0644 %{SOURCE4} %{buildroot}%{_libexecdir}/tmpfiles.d/%{name}.conf +install -Dm 0644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}[email protected] +install -Dm 0644 %{SOURCE8} %{buildroot}%{_unitdir}/%{name}-sentinel.target + ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} cp %{SOURCE5} README.SUSE @@ -107,7 +119,7 @@ 'child process exited abnormally' -- sometimes it works. --------------------------------------------------- EOF -make %{?_smp_mflags} test && true +make %{?_smp_mflags} test || true %endif %pre @@ -115,18 +127,18 @@ getent passwd %{name} >/dev/null || \ %{_sbindir}/useradd -g %{name} -s /bin/false -r \ -c "User for %{name} key-value store" -d %{_data_dir} %{name} || : -%service_add_pre %{name}.target +%service_add_pre redis.target [email protected] redis-sentinel.target [email protected] %post systemd-tmpfiles --create %{_libexecdir}/tmpfiles.d/%{name}.conf || true -%service_add_post %{name}.target +%service_add_post redis.target [email protected] redis-sentinel.target [email protected] echo "See %{_docdir}/%{name}/README.SUSE to continue" %preun -%service_del_preun %{name}.target +%service_del_preun redis.target [email protected] redis-sentinel.target [email protected] %postun -%service_del_postun %{name}.target +%service_del_postun redis.target [email protected] redis-sentinel.target [email protected] %files %license COPYING @@ -139,6 +151,8 @@ %{_libexecdir}/tmpfiles.d/%{name}.conf %{_unitdir}/%{name}@.service %{_unitdir}/%{name}.target +%{_unitdir}/%{name}[email protected] +%{_unitdir}/%{name}-sentinel.target %doc README.SUSE %config(noreplace) %attr(-,root,%{name}) %{_conf_dir}/ %dir %attr(0750,%{name},%{name}) %{_data_dir} ++++++ README.SUSE ++++++ --- /var/tmp/diff_new_pack.RZDRnU/_old 2018-09-11 17:16:03.715524121 +0200 +++ /var/tmp/diff_new_pack.RZDRnU/_new 2018-09-11 17:16:03.715524121 +0200 @@ -1,41 +1,84 @@ README.SUSE ------------- -1. copy /etc/redis/default.conf.example to /etc/redis/default.conf (or - /etc/redis/otherapp.conf and so on) For the example we will use - otherapp.conf + Redis Server +============== + +1. cp -a /etc/redis/default.conf.example /etc/redis/instancename.conf + +We use the "cp -a" here, so that our permissions are preserved. +In case you copied the file with out the "-a" + +chown root:redis /etc/redis/instancename.conf +chmod u=rw,g=r,o= /etc/redis/instancename.conf 2. change at least pidfile, logfile and dir setting # the pid file *has* to match your config filename without the ".conf" -pidfile /var/run/redis/otherapp.pid -logfile /var/log/redis/otherapp.log -dir /var/lib/redis/otherapp/ + +pidfile /var/run/redis/instancename.pid +logfile /var/log/redis/instancename.log +dir /var/lib/redis/instancename/ If you want to run more than one instance you also have to change the socket path and/or the ip:port combination. - e.g. /var/run/redis/otherapp.sock - -If you plan to use redis in combination with apache, then you should -add 'redis' to apache group and set 'unixsocketperm 770': -$ usermod -a -G redis wwwrun -$ systemctl restart apache2 -then apache is able to connect to redis socket + e.g. /var/run/redis/instancename.sock Also make sure if you copy configurations from somewhere, that "daemonize" should be set to "no". -3a. create the database dir: -$ install -d -o redis -g redis -m 0750 /var/lib/redis/otherapp/ +3. create the database dir: +$ install -d -o redis -g redis -m 0750 /var/lib/redis/instancename/ -3b. add limits (ulimit) to each service -$ install -d -m 0755 /etc/systemd/system/[email protected] -$ echo "[Service] -LimitNOFILE=10240" > /etc/systemd/system/[email protected]/limits.conf +4. systemctl start redis@instancename +5. systemctl enable redis@instancename -4. systemctl start redis@otherapp -5. systemctl enable redis@otherapp - -6. to interact with all instances at the same time use: +6. To stop/restart all instances at the same time use: systemctl restart redis.target systemctl stop redis.target + + Redis Sentinel +================ + +1. cp -a /etc/redis/sentinel.conf.example /etc/redis/sentinel-instancename.conf + +We use the "cp -a" here, so that our permissions are preserved. +In case you copied the file with out the "-a" + +chown root:redis /etc/redis/sentinel-instancename.conf +chmod u=rw,g=rw,o= /etc/redis/sentinel-instancename.conf + +Please note that the sentinel config needs write permissions for the group. +The chmod line differs from the line for the normal redis server. + +2. change at least pidfile, logfile setting +# the pid file *has* to match your config filename without the ".conf" + +pidfile /var/run/redis/instancename.pid +logfile /var/log/redis/instancename.log + +If you want to run more than one instance you also have to change the +socket path and/or the ip:port combination. + e.g. /var/run/redis/instancename.sock + +Also make sure if you copy configurations from somewhere, that "daemonize" +should be set to "no". + +4. systemctl start redis-sentinel@instancename +5. systemctl enable redis-sentinel@instancename + +6. To stop/restart all instances at the same time use: + +systemctl restart redis-sentinel.target +systemctl stop redis-sentinel.target + + Integration with apache when using unix domain sockets +========================================================= + +If you plan to use redis in combination with apache, then you should +add 'redis' to apache group and set 'unixsocketperm 770': +$ usermod -a -G redis wwwrun +$ systemctl restart apache2 +then apache is able to connect to redis socket + + ++++++ redis-conf.patch ++++++ --- /var/tmp/diff_new_pack.RZDRnU/_old 2018-09-11 17:16:03.719524115 +0200 +++ /var/tmp/diff_new_pack.RZDRnU/_new 2018-09-11 17:16:03.723524109 +0200 @@ -48,3 +48,21 @@ ################################# REPLICATION ################################# +Index: sentinel.conf +=================================================================== +--- sentinel.conf.orig ++++ sentinel.conf +@@ -1,4 +1,8 @@ + # Example sentinel.conf ++# ++pidfile /var/run/redis/sentinel-default.pid ++loglevel notice ++logfile /var/log/redis/sentinel-default.log + + # *** IMPORTANT *** + # +@@ -202,4 +206,3 @@ sentinel failover-timeout mymaster 18000 + # to get the program executed. + + sentinel deny-scripts-reconfig yes +- ++++++ redis-sentinel.target ++++++ [Unit] Description=Redis Sentinel target allowing to start/stop all [email protected] instances at once ++++++ [email protected] ++++++ [Unit] Description=Redis After=network.target PartOf=redis-sentinel.target [Service] Type=simple User=redis Group=redis PrivateTmp=true PIDFile=/var/run/redis/sentinel-%i.pid ExecStart=/usr/sbin/redis-sentinel /etc/redis/sentinel-%i.conf LimitNOFILE=10240 Restart=on-failure [Install] WantedBy=multi-user.target redis.target ++++++ [email protected] ++++++ --- /var/tmp/diff_new_pack.RZDRnU/_old 2018-09-11 17:16:03.787524010 +0200 +++ /var/tmp/diff_new_pack.RZDRnU/_new 2018-09-11 17:16:03.787524010 +0200 @@ -10,6 +10,7 @@ PrivateTmp=true PIDFile=/var/run/redis/%i.pid ExecStart=/usr/sbin/redis-server /etc/redis/%i.conf +LimitNOFILE=10240 Restart=on-failure [Install]
