Adrian Moya's picture

Hi guys, I'm starting to work with TKLPatch, in an Ubuntu Lucid VM. I copied the iso inside the VM and did the following commands:

 

tklpatch-extract-iso turnkey-core-beta-lucid-x86.iso
tklpatch-chroot turnkey-core-beta-lucid-x86.rootfs/ apt-get update
But it seems that inside the rootfs of the extracted iso I can't get connection. I fix the issue "by hand" writing to /etc/resolv.conf to continue testing but then I'm stuck being unable to install mysql-server. 
 
The errors I'm getting are the following during package instalation:
 

Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.41-3ubuntu12.3_i386.deb) ...
df: Warning: cannot read table of mounted file systems: No such file or directory
 
Setting up mysql-server-5.1 (5.1.41-3ubuntu12.3) ...
status: Unknown job: mysql
start: Unknown job: mysql
 
root@core ~# service mysql status
status: Unknown job: mysql
root@core ~# service mysql start 
start: Unknown job: mysql
 
Any help will be appreciated. Thanks. The complete transcript of the session can be found at 
 
Forum: 
Dan Robertson's picture

Does your first issue have anything to do with the networking errors other people have reported on the new beta?  See http://www.turnkeylinux.org/blog/core-lucid-beta#comment-3182

Adrian Moya's picture

I do have the problem mentioned on the refered post, not getting nameservers on first boot, and having to hit DHCP option in confconsole to resolve the problem. But once its solved, the VM has internet, I can ping and wget from console. It's just when I chroot to the extracted iso filesystem that I'm getting this error. 

The mysql error is stranger than the first. Has anybody had this issue? 

Liraz Siri's picture

I'm managed to reproduce the problem on my end and investigate what is going on. It turns out that in Lucid, a few server services including mysql have been converted to use upstart instead of sysvinit.

Unfortunately, upstart doesn't support chroots. This is a regression. Previously it was possible to start services inside a chroot environment, but not any more:

https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/430224

I'm looking for a workaround.

Liraz Siri's picture

I pushed my changes to GitHub. Alon is updating the archive as we speak so you'll be able to update to the newest version of tklpatch by doing this:

apt-get update
apt-get install tklpatch

Changes:

  1. fixed resolv.conf handling in tklpatch-chroot (so you don't have to do this manually)
  2. add (tklpatch) to chroot shell prompt. That way you always know you're in the chroot shell.
  3. fixed TERM support in tklpatch-chroot. Now any program that needs a terminal will work (e.g., screen, less, vim). This also adds color to ls and grep.
  4. temporarily labotomize upstart to allow mysql service to start and stop normally inside chroot. It's a hack, but if we need we can extend this approach to other services as well.

Other server services which are known to use upstart in Lucid are samba, vsftpd, squid. But I think for tklpatch we only need the ability to start mysql within the chroot (e.g., to manipulate the databases).

Jeremy Davis's picture

Nice work!

Liraz Siri's picture

If he hadn't found that problem I wouldn't have had nearly as much fun today finding a solution!
Adrian Moya's picture

Liraz, thanks for the update, everything worked as expected. But the final image gets (tklpatch) on the shell prompt. It's the only issue I found. I'm leaving tonight the final test of the patch running and tomorrow if everything went ok I'll publish it. 

Add new comment