Merge lp:~percona-core/percona-server/release-5.5.39-36.0 into lp:percona-server/5.5

Proposed by Tomislav Plavcic on 2014-09-01
Status: Merged
Approved by: Laurynas Biveinis on 2014-09-01
Approved revision: 697
Merged at revision: 696
Proposed branch: lp:~percona-core/percona-server/release-5.5.39-36.0
Merge into: lp:percona-server/5.5
Diff against target: 513 lines (+281/-7)
6 files modified
build-ps/debian/changelog (+6/-0)
build-ps/percona-server.spec (+146/-5)
build-ps/rpm/mysql-systemd (+92/-0)
build-ps/rpm/mysql.service (+31/-0)
policy/selinux/percona-server.te (+5/-1)
storage/innobase/include/univ.i (+1/-1)
To merge this branch: bzr merge lp:~percona-core/percona-server/release-5.5.39-36.0
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) 2014-09-01 Approve on 2014-09-01
Review via email: mp+232862@code.launchpad.net

This proposal supersedes a proposal from 2014-09-01.

Description of the change

Release branch for version 5.5.39-36.0

To post a comment you must log in.
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

See BLD-193.

review: Needs Information
Tomislav Plavcic (tplavcic) wrote : Posted in a previous version of this proposal

From BLD-193:
Since we had PS releases on friday there was no time to make changes and test for PS (5.5/5.6) but "sed" part will not stay. So before GA I'll add our version of my.cnf and remove sed part (if there's no conclusion that this is wrong and something else needs to be done).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-ps/debian/changelog'
2--- build-ps/debian/changelog 2014-08-22 10:09:55 +0000
3+++ build-ps/debian/changelog 2014-09-01 09:03:46 +0000
4@@ -1,3 +1,9 @@
5+percona-server-5.5 (5.5.39-rel36.0) unstable; urgency=low
6+
7+ * Added mysqld-debug
8+
9+ -- Tomislav Plavcic <tomislav.plavcic@percona.com> Thu, 28 Aug 2014 09:25:38 +0200
10+
11 percona-server-5.5 (5.5.38-rel35.2) unstable; urgency=low
12
13 * Fixed missing libperconaserverclient lib in lucid/squeeze
14
15=== modified file 'build-ps/percona-server.spec'
16--- build-ps/percona-server.spec 2014-08-22 10:09:55 +0000
17+++ build-ps/percona-server.spec 2014-09-01 09:03:46 +0000
18@@ -38,6 +38,19 @@
19 %define release rel%{percona_server_version}%{?dist}
20
21 #
22+%bcond_with systemd
23+#
24+%if %{with systemd}
25+ %define systemd 1
26+%else
27+ %if 0%{?rhel} > 6
28+ %define systemd 1
29+ %else
30+ %define systemd 0
31+ %endif
32+%endif
33+
34+#
35 # Macros we use which are not available in all supported versions of RPM
36 #
37 # - defined/undefined are missing on RHEL4
38@@ -185,7 +198,7 @@
39 %define distro_description Generic Linux (kernel %{generic_kernel})
40 %define distro_releasetag linux%{generic_kernel}
41 %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel libaio-devel bison cmake
42- %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
43+ %define distro_requires coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd
44 %endif
45
46 # ----------------------------------------------------------------------------
47@@ -226,6 +239,9 @@
48 Vendor: %{percona_server_vendor}
49 Provides: mysql-server
50 BuildRequires: %{distro_buildreq} pam-devel openssl-devel
51+%if 0%{?systemd}
52+BuildRequires: systemd
53+%endif
54
55 # Think about what you use here since the first step is to
56 # run a rm -rf
57@@ -249,6 +265,16 @@
58 Summary: Percona Server: a very fast and reliable SQL database server
59 Group: Applications/Databases
60 Requires: %{distro_requires} Percona-Server-shared%{product_suffix} Percona-Server-client%{product_suffix}
61+Requires: perl(Data::Dumper)
62+%if 0%{?systemd}
63+Requires(post): systemd
64+Requires(preun): systemd
65+Requires(postun): systemd
66+%else
67+Requires(post): /sbin/chkconfig
68+Requires(preun): /sbin/chkconfig
69+Requires(preun): /sbin/service
70+%endif
71 Provides: mysql-server MySQL-server
72 Conflicts: Percona-SQL-server-50 Percona-Server-server-51
73
74@@ -268,6 +294,28 @@
75 package "Percona-Server-client%{product_suffix}" as well!
76
77 # ----------------------------------------------------------------------------
78+%package -n Percona-Server-selinux%{product_suffix}
79+Summary: Percona Server - Selinux policy module
80+Group: Applications/Databases
81+%if 0%{?rhel} >= 6
82+BuildArch: noarch
83+%endif
84+Requires: selinux-policy
85+Requires(post): policycoreutils
86+Requires(postun): policycoreutils
87+
88+%if 0%{?rhel} == 6
89+BuildRequires: selinux-policy
90+%else
91+BuildRequires: selinux-policy-devel
92+%endif
93+
94+%description -n Percona-Server-selinux%{product_suffix}
95+This package contains SELinux policy module for Percona Server package.
96+
97+For a description of Percona Server see http://www.percona.com/software/percona-server/
98+
99+# ----------------------------------------------------------------------------
100 %package -n Percona-Server-client%{product_suffix}
101 Summary: Percona Server - Client
102 Group: Applications/Databases
103@@ -283,6 +331,7 @@
104 # ----------------------------------------------------------------------------
105 %package -n Percona-Server-test%{product_suffix}
106 Requires: Percona-Server-client%{product_suffix} perl
107+Requires: perl(Socket), perl(Time::HiRes), perl(Data::Dumper), perl(Test::More), perl(Env)
108 Summary: Percona Server - Test suite
109 Group: Applications/Databases
110 Provides: mysql-test
111@@ -474,6 +523,13 @@
112 install -d $RBR%{_sbindir}
113 install -d $RBR%{_libdir}/mysql/plugin
114
115+# SElinux
116+pushd ${MBD}/policy
117+make -f /usr/share/selinux/devel/Makefile
118+install -D -m 0644 $MBD/policy/percona-server.pp $RBR%{_datadir}/selinux/packages/percona-server/percona-server.pp
119+popd
120+# SElinux END
121+
122 (
123 cd $MBD/release
124 make DESTDIR=$RBR benchdir_root=%{_datadir} install
125@@ -496,7 +552,12 @@
126
127 # Install logrotate and autostart
128 install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
129+%if 0%{?systemd}
130+install -D -m 0755 $MBD/build-ps/rpm/mysql-systemd $RBR%{_bindir}/mysql-systemd
131+install -D -m 0644 $MBD/build-ps/rpm/mysql.service $RBR%{_unitdir}/mysql.service
132+%else
133 install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
134+%endif
135
136 # Delete the symlinks to the libraries from the libdir. These are created by
137 # ldconfig(8) afterwards.
138@@ -522,9 +583,12 @@
139 "$RBR%{_libdir}/mysql/%{malloc_lib_target}"
140 %endif
141
142-# Remove man pages we explicitly do not want to package, avoids 'unpackaged
143+# Remove files we explicitly do not want to package, avoids 'unpackaged
144 # files' warning.
145 rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
146+%if 0%{?systemd}
147+rm -rf $RBR%{_sysconfdir}/init.d/mysql
148+%endif
149
150 ##############################################################################
151 # Post processing actions, i.e. when installed
152@@ -532,6 +596,15 @@
153
154 %pre -n Percona-Server-server%{product_suffix}
155
156+# On rhel7 change default MariaDB options if they exists (only on initial installation)
157+%if "%rhel" > "6"
158+if [ $1 -eq 1 -a -f /etc/my.cnf ]; then
159+ sed -i 's/log-error=\/var\/log\/mariadb\/mariadb.log/log-error=\/var\/log\/mysqld.log/g' /etc/my.cnf;
160+ sed -i 's/pid-file=\/var\/run\/mariadb\/mariadb.pid/pid-file=\/var\/run\/mysqld\/mysqld.pid/g' /etc/my.cnf;
161+ sed -i 's/\!includedir \/etc\/my.cnf.d/\#\!includedir \/etc\/my.cnf.d/g' /etc/my.cnf;
162+fi
163+%endif
164+
165 # ATTENTION: Parts of this are duplicated in the "triggerpostun" !
166
167 # There are users who deviate from the default file system layout.
168@@ -687,11 +760,31 @@
169 # Note we *could* make that depend on $SERVER_TO_START, but we rather don't,
170 # so a "stop" is attempted even if there is no PID file.
171 # (Maybe the "stop" doesn't work then, but we might fix that in itself.)
172+%if 0%{?systemd}
173+SYSD_ACTIVE=$(systemctl is-active mysql)
174+if [ $SYSD_ACTIVE == "active" ] ; then
175+ %{_bindir}/systemctl stop mysql >/dev/null 2>&1
176+ echo "Giving mysqld 5 seconds to exit nicely"
177+ sleep 5
178+fi
179+%else
180 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
181 %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
182 echo "Giving mysqld 5 seconds to exit nicely"
183 sleep 5
184 fi
185+%endif
186+
187+# SElinux
188+%post -n Percona-Server-selinux%{product_suffix}
189+/usr/sbin/semodule -i %{_datadir}/selinux/packages/percona-server/percona-server.pp >/dev/null 2>&1 || :
190+
191+%postun -n Percona-Server-selinux%{product_suffix}
192+if [ $1 -eq 0 ] ; then
193+ /usr/sbin/semodule -r percona-server >/dev/null 2>&1 || :
194+fi
195+
196+#SElinux
197
198 %post -n Percona-Server-server%{product_suffix}
199 if [ X${PERCONA_DEBUG} == X1 ]; then
200@@ -761,12 +854,18 @@
201 # NOTE: This still needs to be debated. Should we check whether these links
202 # for the other run levels exist(ed) before the upgrade?
203 # use chkconfig on Enterprise Linux and newer SuSE releases
204+%if 0%{?systemd}
205+if [ -x %{_bindir}/systemctl ] ; then
206+ %{_bindir}/systemctl enable mysql >/dev/null 2>&1
207+fi
208+%else
209 if [ -x /sbin/chkconfig ] ; then
210 /sbin/chkconfig --add mysql
211 # use insserv for older SuSE Linux versions
212 elif [ -x /sbin/insserv ] ; then
213 /sbin/insserv %{_sysconfdir}/init.d/mysql
214 fi
215+%endif
216
217 # ----------------------------------------------------------------------
218 # Upgrade databases if needed would go here - but it cannot be automated yet
219@@ -797,12 +896,18 @@
220
221 # Was the server running before the upgrade? If so, restart the new one.
222 if [ "$SERVER_TO_START" = "true" ] ; then
223+%if 0%{?systemd}
224+if [ -x %{_bindir}/systemctl ] ; then
225+ %{_bindir}/systemctl start mysql
226+fi
227+%else
228 # Restart in the same way that mysqld will be started normally.
229 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
230 %{_sysconfdir}/init.d/mysql start
231- echo "Giving mysqld 5 seconds to start"
232- sleep 5
233 fi
234+%endif
235+ echo "Giving mysqld 5 seconds to start"
236+ sleep 5
237 fi
238
239 echo "Percona Server is distributed with several useful UDF (User Defined Function) from Percona Toolkit."
240@@ -839,6 +944,12 @@
241 # http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
242
243 if [ $1 = 0 ] ; then
244+%if 0%{?systemd}
245+ if [ -x %{_bindir}/systemctl ] ; then
246+ %{_bindir}/systemctl stop mysql > /dev/null
247+ %{_bindir}/systemctl disable mysql > /dev/null
248+ fi
249+%else
250 # Stop MySQL before uninstalling it
251 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
252 %{_sysconfdir}/init.d/mysql stop > /dev/null
253@@ -851,6 +962,7 @@
254 /sbin/insserv -r %{_sysconfdir}/init.d/mysql
255 fi
256 fi
257+%endif
258 fi
259
260 # We do not remove the mysql user since it may still own a lot of
261@@ -893,21 +1005,35 @@
262 fi
263 echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
264
265+%if 0%{?systemd}
266+if [ -x %{_bindir}/systemctl ] ; then
267+ %{_bindir}/systemctl enable mysql >/dev/null 2>&1
268+fi
269+%else
270 if [ -x /sbin/chkconfig ] ; then
271 /sbin/chkconfig --add mysql
272 # use insserv for older SuSE Linux versions
273 elif [ -x /sbin/insserv ] ; then
274 /sbin/insserv %{_sysconfdir}/init.d/mysql
275 fi
276+%endif
277
278 # Was the server running before the upgrade? If so, restart the new one.
279 if [ "$SERVER_TO_START" = "true" ] ; then
280- # Restart in the same way that mysqld will be started normally.
281+# Restart in the same way that mysqld will be started normally.
282+%if 0%{?systemd}
283+ if [ -x %{_bindir}/systemctl ] ; then
284+ %{_bindir}/systemctl start mysql
285+ echo "Giving mysqld 5 seconds to start"
286+ sleep 5
287+ fi
288+%else
289 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
290 %{_sysconfdir}/init.d/mysql start
291 echo "Giving mysqld 5 seconds to start"
292 sleep 5
293 fi
294+%endif
295 fi
296
297 echo "Trigger 'postun --community' finished at `date`" >> $STATUS_HISTORY
298@@ -926,6 +1052,10 @@
299 # Files section
300 ##############################################################################
301
302+%files -n Percona-Server-selinux%{product_suffix}
303+%dir %attr(755, root, root) %{_datadir}/selinux/packages/percona-server
304+%attr(644, root, root) %{_datadir}/selinux/packages/percona-server/percona-server.pp
305+
306 %files -n Percona-Server-server%{product_suffix}
307 %defattr(-,root,root,0755)
308
309@@ -965,6 +1095,9 @@
310 %doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
311 %doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
312 %doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
313+%if 0%{?systemd}
314+%attr(755, root, root) %{_bindir}/mysql-systemd
315+%endif
316
317 %ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
318
319@@ -1052,7 +1185,11 @@
320 %endif
321
322 %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
323+%if 0%{?systemd}
324+%attr(644, root, root) %{_unitdir}/mysql.service
325+%else
326 %attr(755, root, root) %{_sysconfdir}/init.d/mysql
327+%endif
328
329 %attr(755, root, root) %{_datadir}/percona-server/
330
331@@ -1141,6 +1278,10 @@
332 %doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
333
334 %changelog
335+* Tue Aug 26 2014 Tomislav Plavcic <tomislav.plavcic@percona.com>
336+
337+- Added support for centos7
338+
339 * Thu May 29 2014 Tomislav Plavcic <tomislav.plavcic@percona.com>
340
341 - UDF and HandlerSocket moved to plugin
342
343=== added directory 'build-ps/rpm'
344=== added file 'build-ps/rpm/mysql-systemd'
345--- build-ps/rpm/mysql-systemd 1970-01-01 00:00:00 +0000
346+++ build-ps/rpm/mysql-systemd 2014-09-01 09:03:46 +0000
347@@ -0,0 +1,92 @@
348+#! /bin/bash
349+#
350+# Scripts to run by Percona Server systemd service
351+#
352+# Needed argument: pre | post
353+#
354+# pre mode : try to run mysql_install_db and fix perms and SELinux contexts
355+# post mode : ping server until answer is received
356+#
357+
358+parse_cnf()
359+{
360+ local var=$1
361+ shift
362+ local groups=$*
363+ reval=$(my_print_defaults $groups | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -n 1 )
364+ if [[ -z ${reval:-} ]];then
365+ reval=""
366+ fi
367+ echo $reval
368+}
369+
370+install_db () {
371+ # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
372+ log=$(parse_cnf log-error server mysqld mysqld_safe)
373+ datadir=$(parse_cnf datadir server mysqld)
374+ if [[ -z ${datadir:-} ]]; then
375+ datadir="/var/lib/mysql"
376+ fi
377+
378+ # Check that pid-file directory exists and has valid permissions
379+ pid_path=$(parse_cnf pid-file server mysqld mysqld_safe)
380+ if [[ -z "${pid_path:-}" ]]; then
381+ pid_path=$datadir/`hostname`.pid
382+ else
383+ case "$pid_path" in
384+ /* ) ;;
385+ * ) pid_path="$datadir/$pid_path" ;;
386+ esac
387+ fi
388+ pidfiledir=$(dirname $pid_path)
389+
390+ if [ ! -z $pidfiledir ]; then
391+ [ -d "$pidfiledir" ] || install -d -m 0755 -omysql -gmysql "$pidfiledir" || exit 1
392+ fi
393+
394+ # Restore log, dir, perms and SELinux contexts
395+ [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
396+ if [ -x /usr/sbin/restorecon ]; then
397+ /usr/sbin/restorecon "$datadir"
398+ if [ ! -z $pidfiledir ]; then
399+ /usr/sbin/restorecon "$pidfiledir"
400+ fi
401+ fi
402+
403+ # If log file is not specified it's put into datadir by default
404+ if [ ! -z $log ]; then
405+ [ -e $log ] || touch $log
406+ chmod 0640 $log
407+ chown mysql:mysql $log || exit 1
408+ if [ -x /usr/sbin/restorecon ]; then
409+ /usr/sbin/restorecon $log
410+ fi
411+ fi
412+
413+ # If special mysql dir is in place, skip db install
414+ [ -d "$datadir/mysql" ] && exit 0
415+
416+ # Create initial db
417+ /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
418+ exit 0
419+}
420+
421+pinger () {
422+ # Wait for ping to answer to signal startup completed,
423+ # might take a while in case of e.g. crash recovery
424+ # MySQL systemd service will timeout script if no answer
425+ while /bin/true ; do
426+ sleep 1
427+ mysqladmin ping >/dev/null 2>&1 && break
428+ done
429+ exit 0
430+}
431+
432+# main
433+case $1 in
434+ "pre") install_db ;;
435+ "post") pinger ;;
436+esac
437+
438+exit 0
439+
440
441=== added file 'build-ps/rpm/mysql.service'
442--- build-ps/rpm/mysql.service 1970-01-01 00:00:00 +0000
443+++ build-ps/rpm/mysql.service 2014-09-01 09:03:46 +0000
444@@ -0,0 +1,31 @@
445+#
446+# Systemd service file for Percona Server
447+#
448+# # This service file is to start PS just with mysqld_safe
449+#
450+
451+[Unit]
452+Description=MySQL Percona Server
453+After=network.target
454+After=syslog.target
455+
456+[Install]
457+WantedBy=multi-user.target
458+Alias=mysql.service
459+
460+[Service]
461+# Needed to create system tables etc.
462+ExecStartPre=/usr/bin/mysql-systemd pre
463+
464+# Start main service
465+ExecStart=/usr/bin/mysqld_safe
466+
467+# Don't signal startup success before a ping works
468+ExecStartPost=/usr/bin/mysql-systemd post
469+
470+# Give up if ping don't get an answer
471+TimeoutSec=600
472+
473+Restart=always
474+PrivateTmp=false
475+
476
477=== modified file 'policy/selinux/percona-server.te'
478--- policy/selinux/percona-server.te 2013-03-01 19:17:07 +0000
479+++ policy/selinux/percona-server.te 2014-09-01 09:03:46 +0000
480@@ -11,8 +11,9 @@
481 class sock_file { getattr unlink create };
482 class capability { sys_nice sys_resource };
483 class blk_file { read write open };
484- class file { write getattr read create unlink open };
485+ class file { append write getattr read create unlink open setattr };
486 class dir { search read write remove_name open add_name };
487+ class process { siginh noatsecure rlimitinh };
488 }
489
490 #============= mysqld_safe_t ==============
491@@ -22,6 +23,9 @@
492 allow mysqld_safe_t tmp_t:sock_file { getattr unlink };
493 allow mysqld_safe_t user_tmp_t:sock_file { getattr unlink };
494
495+#!!!! This avc has a dontaudit rule in the current policy
496+allow mysqld_safe_t mysqld_t:process { siginh rlimitinh noatsecure };
497+
498 #============= mysqld_t ==============
499 allow mysqld_t fixed_disk_device_t:blk_file { read write open };
500 allow mysqld_t tmp_t:sock_file { create unlink };
501
502=== modified file 'storage/innobase/include/univ.i'
503--- storage/innobase/include/univ.i 2014-08-22 10:09:55 +0000
504+++ storage/innobase/include/univ.i 2014-09-01 09:03:46 +0000
505@@ -64,7 +64,7 @@
506 (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
507
508 #ifndef PERCONA_INNODB_VERSION
509-#define PERCONA_INNODB_VERSION 35.2
510+#define PERCONA_INNODB_VERSION 36.0
511 #endif
512
513 #define INNODB_VERSION_STR MYSQL_SERVER_VERSION

Subscribers

People subscribed via source and target branches