Merge lp:~percona-core/percona-server/release-5.6.20-68.0 into lp:percona-server/5.6

Proposed by Tomislav Plavcic
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 656
Proposed branch: lp:~percona-core/percona-server/release-5.6.20-68.0
Merge into: lp:percona-server/5.6
Diff against target: 516 lines (+282/-8)
6 files modified
build-ps/debian/changelog (+6/-0)
build-ps/percona-server.spec (+147/-6)
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.6.20-68.0
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+232863@code.launchpad.net

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

Description of the change

Release branch for version 5.6.20-68.0

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

See BLD-193

review: Needs Information
Revision history for this message
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).

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
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 13:31:49 +0000
3+++ build-ps/debian/changelog 2014-09-01 09:04:28 +0000
4@@ -1,3 +1,9 @@
5+percona-server-5.6 (5.6.20-rel68.0) unstable; urgency=low
6+
7+ * Added mysqld-debug
8+
9+ -- Tomislav Plavcic <tomislav.plavcic@percona.com> Tue, 26 Aug 2014 16:18:06 +0200
10+
11 percona-server-5.6 (5.6.19-rel67.0) unstable; urgency=low
12
13 * Fixed missing libperconaserverclient library
14
15=== modified file 'build-ps/percona-server.spec'
16--- build-ps/percona-server.spec 2014-07-01 08:43:29 +0000
17+++ build-ps/percona-server.spec 2014-09-01 09:04:28 +0000
18@@ -32,6 +32,18 @@
19
20 #
21 %bcond_with tokudb
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 %if %{with tokudb}
36 %define TOKUDB_FLAGS -DWITH_VALGRIND=OFF -DUSE_VALGRIND=OFF -DDEBUG_EXTNAME=OFF -DBUILD_TESTING=OFF -DUSE_GTAGS=OFF -DUSE_CTAGS=OFF -DUSE_ETAGS=OFF -DUSE_CSCOPE=OFF
37@@ -204,7 +216,7 @@
38 %define distro_description Generic Linux (kernel %{generic_kernel})
39 %define distro_releasetag linux%{generic_kernel}
40 %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel libaio-devel bison cmake
41- %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
42+ %define distro_requires coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd
43 %endif
44
45 # ----------------------------------------------------------------------------
46@@ -248,6 +260,9 @@
47 Vendor: %{percona_server_vendor}
48 Provides: mysql-server
49 BuildRequires: %{distro_buildreq} pam-devel openssl-devel
50+%if 0%{?systemd}
51+BuildRequires: systemd
52+%endif
53
54 # Think about what you use here since the first step is to
55 # run a rm -rf
56@@ -271,6 +286,16 @@
57 Summary: Percona Server: a very fast and reliable SQL database server
58 Group: Applications/Databases
59 Requires: %{distro_requires} Percona-Server-shared%{product_suffix} Percona-Server-client%{product_suffix}
60+Requires: perl(Data::Dumper)
61+%if 0%{?systemd}
62+Requires(post): systemd
63+Requires(preun): systemd
64+Requires(postun): systemd
65+%else
66+Requires(post): /sbin/chkconfig
67+Requires(preun): /sbin/chkconfig
68+Requires(preun): /sbin/service
69+%endif
70 Provides: mysql-server MySQL-server
71 Conflicts: Percona-SQL-server-50 Percona-Server-server-51 Percona-Server-server-55
72
73@@ -305,6 +330,28 @@
74 %endif
75
76 # ----------------------------------------------------------------------------
77+%package -n Percona-Server-selinux%{product_suffix}
78+Summary: Percona Server - Selinux policy module
79+Group: Applications/Databases
80+%if 0%{?rhel} >= 6
81+BuildArch: noarch
82+%endif
83+Requires: selinux-policy
84+Requires(post): policycoreutils
85+Requires(postun): policycoreutils
86+
87+%if 0%{?rhel} == 6
88+BuildRequires: selinux-policy
89+%else
90+BuildRequires: selinux-policy-devel
91+%endif
92+
93+%description -n Percona-Server-selinux%{product_suffix}
94+This package contains SELinux policy module for Percona Server package.
95+
96+For a description of Percona Server see http://www.percona.com/software/percona-server/
97+
98+# ----------------------------------------------------------------------------
99 %package -n Percona-Server-client%{product_suffix}
100 Summary: Percona Server - Client
101 Group: Applications/Databases
102@@ -320,6 +367,7 @@
103 # ----------------------------------------------------------------------------
104 %package -n Percona-Server-test%{product_suffix}
105 Requires: Percona-Server-client%{product_suffix} perl
106+Requires: perl(Socket), perl(Time::HiRes), perl(Data::Dumper), perl(Test::More)
107 Summary: Percona Server - Test suite
108 Group: Applications/Databases
109 Provides: mysql-test
110@@ -505,6 +553,13 @@
111 install -d $RBR%{_sbindir}
112 install -d $RBR%{_libdir}/mysql/plugin
113
114+# SElinux
115+pushd ${MBD}/policy
116+make -f /usr/share/selinux/devel/Makefile
117+install -D -m 0644 $MBD/policy/percona-server.pp $RBR%{_datadir}/selinux/packages/percona-server/percona-server.pp
118+popd
119+# SElinux END
120+
121 (
122 cd $MBD/release
123 make DESTDIR=$RBR benchdir_root=%{_datadir} install
124@@ -523,7 +578,13 @@
125
126 # Install logrotate and autostart
127 install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
128+%if 0%{?systemd}
129+install -D -m 0755 $MBD/build-ps/rpm/mysql-systemd $RBR%{_bindir}/mysql-systemd
130+install -D -m 0644 $MBD/build-ps/rpm/mysql.service $RBR%{_unitdir}/mysql.service
131+%else
132 install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
133+%endif
134+
135 #
136 %{__rm} -f $RBR/%{_prefix}/README*
137 #
138@@ -551,9 +612,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@@ -561,6 +625,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@@ -716,11 +789,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
200@@ -757,12 +850,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 # Create a MySQL user and group. Do not report any problems if it already
219@@ -822,12 +921,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@@ -862,8 +967,14 @@
241 # Remove last version of package 0 "
242 #
243 # http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
244-
245+
246 if [ $1 = 0 ] ; then
247+%if 0%{?systemd}
248+ if [ -x %{_bindir}/systemctl ] ; then
249+ %{_bindir}/systemctl stop mysql > /dev/null
250+ %{_bindir}/systemctl disable mysql > /dev/null
251+ fi
252+%else
253 # Stop MySQL before uninstalling it
254 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
255 %{_sysconfdir}/init.d/mysql stop > /dev/null
256@@ -876,6 +987,7 @@
257 /sbin/insserv -r %{_sysconfdir}/init.d/mysql
258 fi
259 fi
260+%endif
261 fi
262
263 # We do not remove the mysql user since it may still own a lot of
264@@ -918,21 +1030,35 @@
265 fi
266 echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
267
268+%if 0%{?systemd}
269+if [ -x %{_bindir}/systemctl ] ; then
270+ %{_bindir}/systemctl enable mysql >/dev/null 2>&1
271+fi
272+%else
273 if [ -x /sbin/chkconfig ] ; then
274 /sbin/chkconfig --add mysql
275 # use insserv for older SuSE Linux versions
276 elif [ -x /sbin/insserv ] ; then
277 /sbin/insserv %{_sysconfdir}/init.d/mysql
278 fi
279+%endif
280
281 # Was the server running before the upgrade? If so, restart the new one.
282 if [ "$SERVER_TO_START" = "true" ] ; then
283- # Restart in the same way that mysqld will be started normally.
284+# Restart in the same way that mysqld will be started normally.
285+%if 0%{?systemd}
286+ if [ -x %{_bindir}/systemctl ] ; then
287+ %{_bindir}/systemctl start mysql
288+ echo "Giving mysqld 5 seconds to start"
289+ sleep 5
290+ fi
291+%else
292 if [ -x %{_sysconfdir}/init.d/mysql ] ; then
293 %{_sysconfdir}/init.d/mysql start
294 echo "Giving mysqld 5 seconds to start"
295 sleep 5
296 fi
297+%endif
298 fi
299
300 echo "Trigger 'postun --community' finished at `date`" >> $STATUS_HISTORY
301@@ -975,6 +1101,10 @@
302 # Files section
303 ##############################################################################
304
305+%files -n Percona-Server-selinux%{product_suffix}
306+%dir %attr(755, root, root) %{_datadir}/selinux/packages/percona-server
307+%attr(644, root, root) %{_datadir}/selinux/packages/percona-server/percona-server.pp
308+
309 %files -n Percona-Server-server%{product_suffix}
310 %defattr(-,root,root,0755)
311
312@@ -1043,6 +1173,9 @@
313 %attr(755, root, root) %{_bindir}/replace
314 %attr(755, root, root) %{_bindir}/resolve_stack_dump
315 %attr(755, root, root) %{_bindir}/resolveip
316+%if 0%{?systemd}
317+%attr(755, root, root) %{_bindir}/mysql-systemd
318+%endif
319
320 %attr(755, root, root) %{_sbindir}/mysqld
321 %attr(755, root, root) %{_sbindir}/mysqld-debug
322@@ -1105,7 +1238,11 @@
323 %endif
324
325 %attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
326+%if 0%{?systemd}
327+%attr(644, root, root) %{_unitdir}/mysql.service
328+%else
329 %attr(755, root, root) %{_sysconfdir}/init.d/mysql
330+%endif
331
332 # %attr(755, root, root) %{_datadir}/percona-server/
333 %attr(755, root, root) %{_datadir}/percona-server/binary-configure
334@@ -1246,6 +1383,10 @@
335 %doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
336
337 %changelog
338+* Tue Aug 26 2014 Tomislav Plavcic <tomislav.plavcic@percona.com>
339+
340+- Added support for centos7
341+
342 * Mon May 26 2014 Tomislav Plavcic <tomislav.plavcic@percona.com>
343
344 - Added packaging changes regarding TokuDB
345
346=== added directory 'build-ps/rpm'
347=== added file 'build-ps/rpm/mysql-systemd'
348--- build-ps/rpm/mysql-systemd 1970-01-01 00:00:00 +0000
349+++ build-ps/rpm/mysql-systemd 2014-09-01 09:04:28 +0000
350@@ -0,0 +1,92 @@
351+#! /bin/bash
352+#
353+# Scripts to run by Percona Server systemd service
354+#
355+# Needed argument: pre | post
356+#
357+# pre mode : try to run mysql_install_db and fix perms and SELinux contexts
358+# post mode : ping server until answer is received
359+#
360+
361+parse_cnf()
362+{
363+ local var=$1
364+ shift
365+ local groups=$*
366+ 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 )
367+ if [[ -z ${reval:-} ]];then
368+ reval=""
369+ fi
370+ echo $reval
371+}
372+
373+install_db () {
374+ # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
375+ log=$(parse_cnf log-error server mysqld mysqld_safe)
376+ datadir=$(parse_cnf datadir server mysqld)
377+ if [[ -z ${datadir:-} ]]; then
378+ datadir="/var/lib/mysql"
379+ fi
380+
381+ # Check that pid-file directory exists and has valid permissions
382+ pid_path=$(parse_cnf pid-file server mysqld mysqld_safe)
383+ if [[ -z "${pid_path:-}" ]]; then
384+ pid_path=$datadir/`hostname`.pid
385+ else
386+ case "$pid_path" in
387+ /* ) ;;
388+ * ) pid_path="$datadir/$pid_path" ;;
389+ esac
390+ fi
391+ pidfiledir=$(dirname $pid_path)
392+
393+ if [ ! -z $pidfiledir ]; then
394+ [ -d "$pidfiledir" ] || install -d -m 0755 -omysql -gmysql "$pidfiledir" || exit 1
395+ fi
396+
397+ # Restore log, dir, perms and SELinux contexts
398+ [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
399+ if [ -x /usr/sbin/restorecon ]; then
400+ /usr/sbin/restorecon "$datadir"
401+ if [ ! -z $pidfiledir ]; then
402+ /usr/sbin/restorecon "$pidfiledir"
403+ fi
404+ fi
405+
406+ # If log file is not specified it's put into datadir by default
407+ if [ ! -z $log ]; then
408+ [ -e $log ] || touch $log
409+ chmod 0640 $log
410+ chown mysql:mysql $log || exit 1
411+ if [ -x /usr/sbin/restorecon ]; then
412+ /usr/sbin/restorecon $log
413+ fi
414+ fi
415+
416+ # If special mysql dir is in place, skip db install
417+ [ -d "$datadir/mysql" ] && exit 0
418+
419+ # Create initial db
420+ /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
421+ exit 0
422+}
423+
424+pinger () {
425+ # Wait for ping to answer to signal startup completed,
426+ # might take a while in case of e.g. crash recovery
427+ # MySQL systemd service will timeout script if no answer
428+ while /bin/true ; do
429+ sleep 1
430+ mysqladmin ping >/dev/null 2>&1 && break
431+ done
432+ exit 0
433+}
434+
435+# main
436+case $1 in
437+ "pre") install_db ;;
438+ "post") pinger ;;
439+esac
440+
441+exit 0
442+
443
444=== added file 'build-ps/rpm/mysql.service'
445--- build-ps/rpm/mysql.service 1970-01-01 00:00:00 +0000
446+++ build-ps/rpm/mysql.service 2014-09-01 09:04:28 +0000
447@@ -0,0 +1,31 @@
448+#
449+# Systemd service file for Percona Server
450+#
451+# # This service file is to start PS just with mysqld_safe
452+#
453+
454+[Unit]
455+Description=MySQL Percona Server
456+After=network.target
457+After=syslog.target
458+
459+[Install]
460+WantedBy=multi-user.target
461+Alias=mysql.service
462+
463+[Service]
464+# Needed to create system tables etc.
465+ExecStartPre=/usr/bin/mysql-systemd pre
466+
467+# Start main service
468+ExecStart=/usr/bin/mysqld_safe
469+
470+# Don't signal startup success before a ping works
471+ExecStartPost=/usr/bin/mysql-systemd post
472+
473+# Give up if ping don't get an answer
474+TimeoutSec=600
475+
476+Restart=always
477+PrivateTmp=false
478+
479
480=== modified file 'policy/selinux/percona-server.te'
481--- policy/selinux/percona-server.te 2013-03-01 19:17:07 +0000
482+++ policy/selinux/percona-server.te 2014-09-01 09:04:28 +0000
483@@ -11,8 +11,9 @@
484 class sock_file { getattr unlink create };
485 class capability { sys_nice sys_resource };
486 class blk_file { read write open };
487- class file { write getattr read create unlink open };
488+ class file { append write getattr read create unlink open setattr };
489 class dir { search read write remove_name open add_name };
490+ class process { siginh noatsecure rlimitinh };
491 }
492
493 #============= mysqld_safe_t ==============
494@@ -22,6 +23,9 @@
495 allow mysqld_safe_t tmp_t:sock_file { getattr unlink };
496 allow mysqld_safe_t user_tmp_t:sock_file { getattr unlink };
497
498+#!!!! This avc has a dontaudit rule in the current policy
499+allow mysqld_safe_t mysqld_t:process { siginh rlimitinh noatsecure };
500+
501 #============= mysqld_t ==============
502 allow mysqld_t fixed_disk_device_t:blk_file { read write open };
503 allow mysqld_t tmp_t:sock_file { create unlink };
504
505=== modified file 'storage/innobase/include/univ.i'
506--- storage/innobase/include/univ.i 2014-08-22 13:31:49 +0000
507+++ storage/innobase/include/univ.i 2014-09-01 09:04:28 +0000
508@@ -47,7 +47,7 @@
509 #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH
510
511 #ifndef PERCONA_INNODB_VERSION
512-#define PERCONA_INNODB_VERSION 67.0
513+#define PERCONA_INNODB_VERSION 68.0
514 #endif
515
516 /* Enable UNIV_LOG_ARCHIVE in XtraDB */

Subscribers

People subscribed via source and target branches

to all changes: