RE: Database creation at install time -- before first boot
In the past when I have wanted something to only be done on the first boot of a fresh install, say for instance when building my own iso installation (using simple-cdd for example), I would have a deb installed that contains a script that does what I want. The script should write a file or some such thing when it has been run successfully. Then in rc.local, wrap a call up in there to your script that sets up what you want. For instance something like:
if [ -f $SCRIPTCOMPLETED ]; then
echo "Nothing to be done"
else
/path/to/script 2>&1
fi
If your script is dependent on certain things running, make it turn them on, if its dependent on things that already come up during the boot process but may take some time and aren't always completely up before rc.local gets executed then place a sleep in your script to give them time to come up.
I recently did this to perform an automated install of large number of .debs on first boot. Theres no reason I can think of that you cannot do similarly for what your stated goal is below.
You could also set it up to have a @reboot cron entry that removes itself after its been run successfully. There are alternatives.
--ray
-----Original Message-----
From: Balbir [mailto:balbir@hvpd.co.uk]
Sent: Thursday, July 22, 2010 4:22 AM
To: debian-blends@lists.debian.org
Subject: Database creation at install time -- before first boot
Hi,
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?
regards
balbir
--
To UNSUBSCRIBE, email to debian-blends-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] 1279786939.3398.4.camel@balbir.ipechvltd.local">http://lists.debian.org/[🔎] 1279786939.3398.4.camel@balbir.ipechvltd.local
Reply to: