← Back to team overview

vmbuilder team mailing list archive

Re: Post install Issues

 

Amol> I'm using VMBuilder and I liked it very much. I have a custom
Amol> package that I install in post install script (--exec script).

Maybe you need to put something into the boot.sh script instead, which
makes sure the mysql is started, and if it's not, starts it up for
you?

That's what I did to set the root password, load the openssh server,
update the fstab, mount some NFS filesystems, etc.  

Amol> This package assumes that MySQL is installed (PreDepends) and as
Amol> part of configuration this package creates a new database in the
Amol> MySQL using something like mysql < db_dump.sql.

Maybe instead install your own startup script, which runs once on
initial bootup, makes sure that mysql is running (mysqladmin status?)
and then loads the DB with your data?  That's how I'd do it. 

Amol> Although I have installed the MySQL by --add-pkg but in the post
Amol> installation script it does not allows me to populate data in the
Amol> database.

Amol> Here is the partial error that I get while VMBuilder runs the post
Amol> installation script.

Amol> 	ldconfig deferred processing now taking place
Amol> 	, stderr: Can not write log, openpty() failed (/dev/pts not mounted?)
Amol> 	Can not write log, openpty() failed (/dev/pts not mounted?)
Amol> 	Can not write log, openpty() failed (/dev/pts not mounted?)
Amol> 	Can not write log, openpty() failed (/dev/pts not mounted?)
Amol> 	ERROR 2002 (HY000): Can't connect to local MySQL server through
Amol> socket '/var/run/mysqld/mysqld.sock' (2)
Amol> 	ERROR 2002 (HY000): Can't connect to local MySQL server through
Amol> socket '/var/run/mysqld/mysqld.sock' (2)
Amol> 	dpkg: error processing custom-server (--configure):
Amol> 	 subprocess post-installation script returned error exit status 1
Amol> 	Errors were encountered while processing:
Amol> 	 custom-server
Amol> 	E: Sub-process /usr/bin/dpkg returned an error code (1)
	
Amol> Can this problem be solved? Since the package expects the MySQL
Amol> is running on the machine.

>From the logs, it really looks like mysql isn't started yet, which
isn't too surprising.  As yet another quick hack, put:

      /etc/init.d/mysql start
      
before your 

       mysql [options] < db_dump.sql

in your --exec script.

Good luck,
John



Follow ups

References