Merge lp:~clint-fewbar/ubuntu/maverick/php5/fix-mysql-tests-apparmor into lp:ubuntu/maverick/php5

Proposed by Clint Byrum
Status: Merged
Merge reported by: Mathias Gug
Merged at revision: not available
Proposed branch: lp:~clint-fewbar/ubuntu/maverick/php5/fix-mysql-tests-apparmor
Merge into: lp:ubuntu/maverick/php5
Diff against target: 71 lines (+23/-2)
3 files modified
debian/changelog (+8/-0)
debian/rules (+2/-0)
debian/setup-mysql.sh (+13/-2)
To merge this branch: bzr merge lp:~clint-fewbar/ubuntu/maverick/php5/fix-mysql-tests-apparmor
Reviewer Review Type Date Requested Status
Mathias Gug Pending
Review via email: mp+35562@code.launchpad.net

Description of the change

This copies mysqld into the build dir while running the build tests (and cleans up after itself when done). This is done to avoid the restrictions imposed on /usr/sbin/mysqld by its default apparmor profile.

To post a comment you must log in.
Revision history for this message
Mathias Gug (mathiaz) wrote :

Looks good. Uploaded to maverick.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2010-08-25 14:04:57 +0000
+++ debian/changelog 2010-09-15 17:54:52 +0000
@@ -1,3 +1,11 @@
1php5 (5.3.3-1ubuntu7) maverick; urgency=low
2
3 * debian/setup-mysql.sh: Copy mysqld to local dir during build to avoid
4 apparmor restrictions (LP: #638401)
5 * debian/rules: stop mysql instance on clean just in case we failed in tests
6
7 -- Clint Byrum <clint@ubuntu.com> Wed, 15 Sep 2010 10:48:32 -0700
8
1php5 (5.3.3-1ubuntu6) maverick; urgency=low9php5 (5.3.3-1ubuntu6) maverick; urgency=low
210
3 * Undo sybase debugging libraries split: keeping a smaller delta with Debian11 * Undo sybase debugging libraries split: keeping a smaller delta with Debian
412
=== modified file 'debian/rules'
--- debian/rules 2010-08-25 14:04:57 +0000
+++ debian/rules 2010-09-15 17:54:52 +0000
@@ -406,6 +406,8 @@
406 rm -rf fpm-build406 rm -rf fpm-build
407 rm -rf pear-build pear-build-download407 rm -rf pear-build pear-build-download
408 rm -f debian/copyright408 rm -f debian/copyright
409 # just in case the build tests failed, kill the running mysqld
410 $(SHELL) debian/setup-mysql.sh $(MYSQL_PORT) $(MYSQL_DATA_DIR) stop > /dev/null 2>&1 || exit 0
409 rm -rf test-results.txt $(MYSQL_DATA_DIR)411 rm -rf test-results.txt $(MYSQL_DATA_DIR)
410 dh_clean -Xorig412 dh_clean -Xorig
411413
412414
=== modified file 'debian/setup-mysql.sh'
--- debian/setup-mysql.sh 2010-07-18 15:35:06 +0000
+++ debian/setup-mysql.sh 2010-09-15 17:54:52 +0000
@@ -12,25 +12,36 @@
12datadir=$212datadir=$2
13action=${3:-start}13action=${3:-start}
1414
15localbase=`dirname $datadir`/mysql_base
16
15# Some vars #17# Some vars #
1618
17socket=$datadir/mysql.sock19socket=$datadir/mysql.sock
18# Commands:20# Commands:
19mysqladmin="mysqladmin -u root -P $port -h localhost --socket=$socket"21mysqladmin="mysqladmin -u root -P $port -h localhost --socket=$socket"
20mysqld="/usr/sbin/mysqld --no-defaults --bind-address=localhost --port=$port --socket=$socket --datadir=$datadir"22mysqld="$localbase/bin/mysqld --no-defaults --bind-address=localhost --port=$port --socket=$socket --datadir=$datadir"
2123
22# Main code #24# Main code #
2325
24if [ "$action" = "stop" ]; then26if [ "$action" = "stop" ]; then
25 $mysqladmin shutdown27 $mysqladmin shutdown
28 rm -rf $localbase
26 exit29 exit
27fi30fi
2831
32# Copy the necessary pieces of mysql to a local dir to avoid apparmor restrictions
33rm -rf $localbase
34mkdir -p $localbase/bin
35mkdir -p $localbase/share
36cp /usr/sbin/mysqld $localbase/bin
37cp /usr/bin/my_print_defaults $localbase/bin
38cp -r /usr/share/mysql $localbase/share
39
29rm -rf $datadir40rm -rf $datadir
30mkdir -p $datadir41mkdir -p $datadir
31chmod go-rx $datadir42chmod go-rx $datadir
3243
33mysql_install_db --datadir=$datadir --rpm --force >> $datadir/bootstrap.log 2>&144mysql_install_db --basedir=$localbase --datadir=$datadir --rpm --force --tmpdir=/tmp >> $datadir/bootstrap.log 2>&1
3445
35tmpf=$(mktemp)46tmpf=$(mktemp)
36cat > "$tmpf" <<EOF47cat > "$tmpf" <<EOF

Subscribers

People subscribed via source and target branches

to all changes: