uck failure with AppArmor enforced daemons inside build chroot (was: uck stops building at 96% after installation of php5 mysql-server-50 and apache2)

Asked by André Gregor-Herrmann

My Problem began like the problem which rothman already reportet:
https://answers.launchpad.net/uck/+question/24327

 I installed the packages php5 apache2 and mysql-server-5.0 via the UCK-Console. While working on the post-script of mysql-package an error is displayed. He failed to start mysql-server, just like in the link above.

[CODE]
dpkg --configure -a
[/CODE]

didn't fix the problem. Deleting the error-message in /var/crash didn't help me too.

If I go on building the building process stops at 96%

Heres my log:
[CODE]
sudo: unable to resolve host andre-laptop
Starting CD remastering on Do 22. Mai 00:31:08 CEST 2008
Customization dir=/home/andre/tmp/customization-scripts
Mounting ISO image...
Unpacking ISO image...
Unmounting ISO image...
Mounting SquashFS image...
Unpacking SquashFS image...
Unmounting SquashFS image...
Removing win32 files...
Copying customization scripts...
Copying resolv.conf...
Copying local apt cache, if available
Mounting X11 sockets directory to allow access from customization environment...
Creating user directory...
Copying X authorization file to chroot filesystem...
xauth: creating new authority file /root/.Xauthority
xauth: creating new authority file /home/andre/.Xauthority
Hit http://security.ubuntu.com hardy-security Release.gpg
Hit http://archive.ubuntu.com hardy Release.gpg
Hit http://security.ubuntu.com hardy-security Release
Hit http://archive.ubuntu.com hardy Release
Hit http://security.ubuntu.com hardy-security/main Packages
Hit http://archive.ubuntu.com hardy/main Packages
Hit http://security.ubuntu.com hardy-security/restricted Packages
Hit http://security.ubuntu.com hardy-security/universe Packages
Hit http://archive.ubuntu.com hardy/restricted Packages
Hit http://archive.ubuntu.com hardy/universe Packages
Hit http://security.ubuntu.com hardy-security/main Sources
Hit http://security.ubuntu.com hardy-security/restricted Sources
Hit http://security.ubuntu.com hardy-security/universe Sources
Hit http://archive.ubuntu.com hardy/main Sources
Hit http://archive.ubuntu.com hardy/restricted Sources
Hit http://archive.ubuntu.com hardy/universe Sources
Reading package lists...
Installing language packs (de)...
Reading package lists...
Building dependency tree...
Reading state information...
language-pack-de is already the newest version.
language-support-de is already the newest version.
language-pack-gnome-de is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Removing unnecessary language packages...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
CHOICE='Run console application'
Starting console application...
CHOICE='Continue building'
Done
Unmounting directory /home/andre/tmp/remaster-root/proc...
Unmounting directory /home/andre/tmp/remaster-root/sys...
Unmounting directory /home/andre/tmp/remaster-root/dev/pts...
Saving apt cache
Cleaning up apt
Removing customize dir...
Cleaning up temporary directories...
Restoring /root directory...
Removing /home/username directory, if created...
Restoring resolv.conf...
Running ISO customization script /home/andre/tmp/customization-scripts/customize_iso...
/tmp/tmp.HfzkiP9465 ~
Paketlisten werden gelesen...
Abhängigkeitsbaum wird aufgebaut...
Reading state information...
NOTICE: 'gfxboot-theme-ubuntu' packaging is maintained in the 'Bzr' version control system at:
http://bazaar.launchpad.net/~ubuntu-core-dev/gfxboot-theme-ubuntu/mainline
Please use:
bzr get http://bazaar.launchpad.net/~ubuntu-core-dev/gfxboot-theme-ubuntu/mainline
to retrieve the latest (possible unreleased) updates to the package.
Überspringe schon heruntergeladene Datei „gfxboot-theme-ubuntu_0.5.20.dsc“
Überspringe schon heruntergeladene Datei „gfxboot-theme-ubuntu_0.5.20.tar.gz“
Es müssen 0B der Quellarchive geholt werden.
Herunterladen abgeschlossen und im Nur-Herunterladen-Modus
rm: Entfernen von „/tmp/gfxboot*“ nicht möglich: No such file or directory
make -C po
make[1]: Betrete Verzeichnis '/tmp/tmp.HfzkiP9465/gfxboot-theme-ubuntu/po'
bin/po2txt bootloader.pot >en.tr
bin/po2txt ar.po >ar.tr
bin/po2txt be.po >be.tr
bin/po2txt bg.po >bg.tr
bin/po2txt bn.po >bn.tr
bin/po2txt bs.po >bs.tr
bin/po2txt ca.po >ca.tr
bin/po2txt cs.po >cs.tr
bin/po2txt da.po >da.tr
bin/po2txt de.po >de.tr
bin/po2txt el.po >el.tr
bin/po2txt eo.po >eo.tr
bin/po2txt es.po >es.tr
bin/po2txt et.po >et.tr
bin/po2txt eu.po >eu.tr
bin/po2txt fi.po >fi.tr
bin/po2txt fr.po >fr.tr
bin/po2txt gl.po >gl.tr
bin/po2txt he.po >he.tr
bin/po2txt hi.po >hi.tr
bin/po2txt hr.po >hr.tr
bin/po2txt hu.po >hu.tr
bin/po2txt id.po >id.tr
bin/po2txt it.po >it.tr
bin/po2txt ja.po >ja.tr
bin/po2txt ka.po >ka.tr
bin/po2txt ko.po >ko.tr
bin/po2txt ku.po >ku.tr
bin/po2txt lt.po >lt.tr
bin/po2txt lv.po >lv.tr
bin/po2txt mk.po >mk.tr
bin/po2txt ml.po >ml.tr
bin/po2txt nb.po >nb.tr
bin/po2txt nl.po >nl.tr
bin/po2txt nn.po >nn.tr
bin/po2txt pl.po >pl.tr
bin/po2txt pt_BR.po >pt_BR.tr
bin/po2txt pt.po >pt.tr
bin/po2txt ro.po >ro.tr
bin/po2txt ru.po >ru.tr
bin/po2txt sk.po >sk.tr
bin/po2txt sl.po >sl.tr
bin/po2txt sq.po >sq.tr
bin/po2txt sv.po >sv.tr
bin/po2txt ta.po >ta.tr
bin/po2txt th.po >th.tr
bin/po2txt tl.po >tl.tr
bin/po2txt tr.po >tr.tr
bin/po2txt uk.po >uk.tr
bin/po2txt vi.po >vi.tr
bin/po2txt zh_CN.po >zh_CN.tr
bin/po2txt zh_TW.po >zh_TW.tr
make[1]: Verlasse Verzeichnis '/tmp/tmp.HfzkiP9465/gfxboot-theme-ubuntu/po'
mkdir -p boot
/usr/bin/mkbootmsg -O -v -L ../.. -l boot/log -c boot.config boot/init
Including "system.inc"
Including "timeout.inc"
Including "common.inc"
Including "theme_colors.inc"
Including "po/text.inc"
Including "window.inc"
Including "button.inc"
Including "help.inc"
Including "main.inc"
Including "menuconfig.inc"
Including "xmenu.inc"
Including "dia_video.inc"
Including "dia_lang.inc"
Including "dia_keymap.inc"
Including "dia_modes.inc"
Including "dia_help.inc"
Including "dia_profile.inc"
Including "dia_bits.inc"
Including "dia_options.inc"
Including "dia_fulloptions.inc"
Including "dia_access.inc"
Including "panel.inc"
Including "keytables.inc"
Including "langnames.inc"
Including "locale.inc"
mkdir -p install
/usr/bin/mkbootmsg -O -v -L ../.. -l install/log -c install.config install/init
Including "system.inc"
Including "timeout.inc"
Including "common.inc"
Including "theme_colors.inc"
Including "po/text.inc"
Including "window.inc"
Including "button.inc"
Including "help.inc"
Including "main.inc"
Including "menuconfig.inc"
Including "xmenu.inc"
Including "dia_video.inc"
Including "dia_lang.inc"
Including "dia_keymap.inc"
Including "dia_modes.inc"
Including "dia_help.inc"
Including "dia_profile.inc"
Including "dia_bits.inc"
Including "dia_options.inc"
Including "dia_fulloptions.inc"
Including "dia_access.inc"
Including "panel.inc"
Including "keytables.inc"
Including "langnames.inc"
Including "locale.inc"
/tmp/tmp.HfzkiP9465/gfxboot-theme-ubuntu/boot /tmp/tmp.HfzkiP9465/gfxboot-theme-ubuntu ~
/tmp/tmp.HfzkiP9465/gfxboot-theme-ubuntu ~
~
Not updating kernel as initrd not present
ISO customization script finished
Updating files lists...
Packing SquashFS image...
Parallel mksquashfs: Using 2 processors
Creating little endian 3.1 filesystem on /home/andre/tmp/remaster-iso/casper/filesystem.squashfs, block size 131072.
TIOCGWINZ ioctl failed, defaulting to 80 columns

[ ] 1/91617 0%
[ ] 2/91617 0%
[ ] 3/91617 0%
[ ] 4/91617 0%
[ ] 5/91617 0%
[ ] 6/91617 0%
[ ] 7/91617 0%
[ ] 8/91617 0%
[ ] 9/91617 0%
[ ] 10/91617 0%
[ ] 11/91617 0%
[ ] 12/91617 0%
[/CODE]

This goes exectly until it reaches 96%

[CODE]
========================================================= ] 88459/91617 96%
[========================================================= ] 88460/91617 96%
[========================================================= ] 88461/91617 96%
[========================================================= ] 88462/91617 96%
[========================================================= ] 88463/91617 96%
[========================================================= ] 88464/91617 96%
[========================================================= ] 88465/91617 96%
[========================================================= ] 88466/91617 96%
[========================================================= ] 88467/91617 96%
[========================================================= ] 88468/91617 96%
[========================================================= ] 88469/91617 96%
[========================================================= ] 88470/91617 96%
[========================================================= ] 88471/91617 96%
[========================================================= ] 88472/91617 96%
[========================================================= ] 88473/91617 96%
[========================================================= ] 88474/91617 96%
[========================================================= ] 88475/91617 96%
[========================================================= ] 88476/91617 96%
[========================================================= ] 88477/91617 96%
[========================================================= ] 88478/91617 96%
[========================================================= ] 88479/91617 96%
[========================================================= ] 88480/91617 96%
[========================================================= ] 88481/91617 96%
[========================================================= ] 88482/91617 96%
[========================================================= ] 88483/91617 96%
[========================================================= ] 88484/91617 96%
[========================================================= ] 88485/91617 96%
[========================================================= ] 88486/91617 96%
[========================================================= ] 88487/91617 96%
[========================================================= ] 88488/91617 96%
[========================================================= ] 88489/91617 96%
[========================================================= ] 88490/91617 96%
[========================================================= ] 88491/91617 96%
[========================================================= ] 88492/91617 96%
[========================================================= ] 88493/91617 96%
[========================================================= ] 88494/91617 96%
[========================================================= ] 88495/91617 96%
[========================================================= ] 88496/91617 96%
[========================================================= ] 88497/91617 96%
[========================================================= ] 88498/91617 96%
[========================================================= ] 88499/91617 96%
[========================================================= ] 88500/91617 96%
[========================================================= ] 88501/91617 96%
[========================================================= ] 88502/91617 96%
[========================================================= ] 88503/91617 96%TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed, defaulting to 80 columns
TIOCGWINSZ ioctl failed,
[/CODE]

Does anyone have a clue whats the reason for that behavior?

Thanks

André

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Customization Kit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
André Gregor-Herrmann (andre-herrmann) said :
#1

OK I checked out the build without installing mysql and it works. So mysql-server-5.0 is the suspect. But i can't explain why.

Hope that anyone recognizes whats going on.

Unfortunately mysql is a core part of my remaster

Thanks for any advice

André

Revision history for this message
Krzysztof Lichota (krzysiek-launchpad-ubuntu-com) said :
#2

As I have already written in the other answer: please attach /var/log/daemon.log

Revision history for this message
André Gregor-Herrmann (andre-herrmann) said :
#3

If you mean these files inside the UCK Console i have to disappoint you. Both files are empty.

Here you can see what is going on in the UCK console, when I install mysql-server-5.0:

root@andre-laptop:/# apt-get install mysql-server-5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client-5.0
Suggested packages:
  dbishell libcompress-zlib-perl mysql-doc-5.0 tinyca
Recommended packages:
  libhtml-template-perl
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-server-5.0
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 36.2MB of archives.
After this operation, 107MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com hardy/main libnet-daemon-perl 0.38-1.1 [45.9kB]
Get:2 http://archive.ubuntu.com hardy/main libplrpc-perl 0.2017-1.1 [35.0kB]
Get:3 http://archive.ubuntu.com hardy/main libdbi-perl 1.601-1 [771kB]
Get:4 http://archive.ubuntu.com hardy/main libdbd-mysql-perl 4.005-1 [134kB]
Get:5 http://archive.ubuntu.com hardy/main mysql-client-5.0 5.0.51a-3ubuntu5 [7824kB]
Get:6 http://archive.ubuntu.com hardy/main mysql-server-5.0 5.0.51a-3ubuntu5 [27.4MB]
Fetched 36.2MB in 1min33s (386kB/s)
Preconfiguring packages ...
Selecting previously deselected package libnet-daemon-perl.
(Reading database ... 103034 files and directories currently installed.)
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1.1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1.1_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.601-1_i386.deb) ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.005-1_i386.deb) ...
Selecting previously deselected package mysql-client-5.0.
Unpacking mysql-client-5.0 (from .../mysql-client-5.0_5.0.51a-3ubuntu5_i386.deb) ...
Selecting previously deselected package mysql-server-5.0.
Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.51a-3ubuntu5_i386.deb) ...
Setting up libnet-daemon-perl (0.38-1.1) ...
Setting up libplrpc-perl (0.2017-1.1) ...
Setting up libdbi-perl (1.601-1) ...
Setting up libdbd-mysql-perl (4.005-1) ...
Setting up mysql-client-5.0 (5.0.51a-3ubuntu5) ...
Setting up mysql-server-5.0 (5.0.51a-3ubuntu5) ...
 * Stopping MySQL database server mysqld [ OK ]
$Loading AppArmor module: Failed.
invoke-rc.d: initscript apparmor, action "force-reload" failed.
 * Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@andre-laptop:/# dpkg --configure -a
Setting up mysql-server-5.0 (5.0.51a-3ubuntu5) ...
 * Stopping MySQL database server mysqld [ OK ]
$Loading AppArmor module: Failed.
invoke-rc.d: initscript apparmor, action "force-reload" failed.
 * Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.0
root@andre-laptop:/# vim /var/log/daemon.log
+root@andre-laptop:/# cat /var/log/daemon.log
root@andre-laptop:/# cat /var/log/syslog
root@andre-laptop:/#

He seems to have problems loading the App Armor module. I looked up if any package is leaving, but i can't see any package that contains this obviously needed module.

Hope this took you a bit further in understanding the failure.

Thanks

André

Revision history for this message
Krzysztof Lichota (krzysiek-launchpad-ubuntu-com) said :
#4

AppArmor cannot start because it is inside chroot. You have to find a
way to disable AppArmor for the time of customization. Maybe some file
in /etc/default controls behaviour of AppArmor? I have no way to check
it as I am not using Hardy.

Revision history for this message
André Gregor-Herrmann (andre-herrmann) said :
#5

Unfurtunatly nothing seems to fix this.

First I removed the apparmor packages. Then I installed mysql with the same result.

Then I took a gutsy-image for building instead. After Installation of mysql-server the same error occured again.

Information: I tried to remaster a gutsy image with uck running on hardy.

I'm of the opinion, that the mysql-deb scripts (post-installation) are the suspects. It's clear, that he cannot start mysql inside chroot.

The best help I could receive at the moment would be an image where mysql-server is already installed.

If anyone has a hint for me in this case, it would really help me.

Greetings

André

Revision history for this message
Paul Sladen (sladen) said :
#6

Crucial issue here is:

  $Loading AppArmor module: Failed.
  invoke-rc.d: initscript apparmor, action "force-reload" failed.
   * Starting MySQL database server mysqld [fail]
  invoke-rc.d: initscript mysql, action "start" failed.

As noted above, the AppArmour isn't startable. It should be able to change the 'mode' for mysql (the level of enforement), eg:

  $ sudo aa-complain mysql
  Setting /etc/apparmor.d/usr.sbin.mysqld to complain mode.
  $ sudo apt-get -f install

This should cause warnings for MySQL, instead of outright failure and hopefully allow installation to proceed. Does this help?

Revision history for this message
André Gregor-Herrmann (andre-herrmann) said :
#7

Thanks for taking care of the problem during the LinuxTag in Berlin, Paul.

But the error is still the same. Like I said, i don't think, that the app-armor-warning is the problem, so it doesn't matter, if i switch off the complain mode.
The Problems are caused somewhere in the mysql installation.

is there a possibility installing mysql without executing the maintainer scripts or prevent start mysql-server right after the installation?

Revision history for this message
Launchpad Janitor (janitor) said :
#8

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
André Gregor-Herrmann (andre-herrmann) said :
#9

The Problem is still the same, but I guess I have a strategy that will work for me. There is more than one remaster-tool. I hope I can solve my Problem by using remastersys for creating an image with mysql inside and afterwards uck for doing the rest of customization.

I have to say, that i gave up testing this, because it's an issue that will get important for me in about a month. I hope I can post a work-around for this behaviour if i succeed.

Greetings

André

Revision history for this message
Krzysztof Lichota (krzysiek-launchpad-ubuntu-com) said :
#10

One of our users found out that build stopping at 96% is actually a bug in squashfs-tools and found a workaround.
See bug 241797.

Revision history for this message
John Bencic (john-bencic-net) said :
#11

I had the same issue with installing mysql-server-5.0 through a chroot whilst building a system

it turns out that because i had mysql running on my machine, when trying to install through chroot i simply stopped the mysql service on my machine and the chroot installation completed successfully

Revision history for this message
Youssef Eldakar (youssefeldakar) said :
#12

I was never able to install mysql-server-5.1 in the UCK chroot on Ubuntu 10.04 with UCK 2.2.1. The mysql-server-5.1 installation process freezes at the "Setting up..." line.

Revision history for this message
Youssef Eldakar (youssefeldakar) said :
#13

I should add that I did stop mysql on the host machine before customization.

Revision history for this message
Wolf Geldmacher (wolf-womaro) said :
#14

I tried to reproduce the problem but failed. I don't have mysql server installed/running on my notebook, though.

I noticed that it does take a long time to perform the "Setting up..." step, though - I assume that this is because it tries to startup mysql server (using the new upstart mechanism "service start mysql") and does not succeed in the chroot environment - but building succeeds eventually and the generated ISO does in fact have mysql server on it and also starts the server when booted (in a virtual machine).

I also believe that this issue is not related in any ways to the bug reported here (too many things have changed since hardy times) - so if the problem persists could you please open up a separate/new error report?

Revision history for this message
Youssef Eldakar (youssefeldakar) said :
#15

I know it has been a while, but I just wanted to quickly note that it did work for me, but I had to run UCK on a machine with MySQL uninstalled, not just stopped.

Can you help with this problem?

Provide an answer of your own, or ask André Gregor-Herrmann for more information if necessary.

To post a message you must log in.