Re: Database creation at install time -- before first boot
> How can one create a database and database user (say, for MySQL) at
> install time, i.e. before first boot? Alternatively how can it be
> setup to take place only on the first boot?
To set up a database during installation from within debian-installer,
you will have to detect the environment and set up everything needed
manually. start-stop-daemoon and invoke-rc.d are all disabled from
within d-i, so there are no services running and it is apain to get
them running too. :)
In Debian Edu, we have written hooks for debian-installer to start
slapd during installation and communicate with it using a unix socket
(network might not be up) to set up Kerberos with LDAP as the backend.
It is a pain to do such things from within d-i. I wish PostgreSQL and
MySQL would be as easy to get running from within d-i as slapd is.
To do things at first boot, we have created a init.d script (see
debian-edu-install), which look for a file in /etc/debian-edu/ and run
at boot if the file is not missing. When the init.d script is done,
it touches the file to make sure it only run once. It is one way to
get things done at first boot.