dab-pve-appliances_2011-05-10.tar.gz - WordPress - PASSWD

do you have any issues with the wordpress appliance? works here as far as I see.
 
Tested on Proxmox VE:
# pveversion -v
Code:
pve-manager: 1.8-15 (pve-manager/1.8/5754)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.8-32
pve-kernel-2.6.32-4-pve: 2.6.32-32
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.24-1pve4
vzdump: 1.2-11
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.14.0-3
ksm-control-daemon: 1.0-5

Wordpress DAB Build Files from dab-pve-appliances_2011-05-10.tar.gz were used to compile the template: debian-6.0-wordpress_3.1.2-1_i386.tar.gz

The said template was used to create a Virtual Machine. On first boot of the Virtual Machine, the following Log was observed:

Code:
starting init logger
INIT: version 2.88 booting
stty: standard input: Invalid argument
Using makefile-style concurrent boot in runlevel S.
Activating swap...done.
mount: permission denied
Cleaning up ifupdown....
Setting up networking....
Fast boot enabled, so skipping file system check. ... (warning).
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Configuring network interfaces...done.
Starting portmap daemon....
Cleaning up temporary files....
Setting kernel variables ...done.
INIT: Entering runlevel: 2
stty: standard input: Invalid argument
Using makefile-style concurrent boot in runlevel 2.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Starting portmap daemon...Already running..
Starting enhanced syslogd: rsyslogd.
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
Starting Postfix Mail Transport Agent: postfix.
generating ssh host keys
update-rc.d: using dependency based boot sequencing
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
Starting OpenBSD Secure Shell server: sshd.
Generate Wordpress Siteconfig
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
Starting web server: apache2.
startpar: service(s) returned failure: mysql_randompw ... failed!
INIT: no more processes left in this runlevel

MySQLd was running and WordPress v3.1.2 was installed correctly despite the errors shown above.

An earlier thread discussing the use of reserved keywords as variables in dash being deprecated and potentially erroneous prompts us to replace PASSWD (like with UPASSWD).

Since both DAB and pve-manager were not upgraded to the 'latest' versions, the vz events issue should not affect it.
 
It is clear from the above that the random password for MySQL root user is not set. The contents of /root/.my.cnf show:
Code:
[client]
user=root
password="admin"

Even after the change of PASSWD to UPASSWD in the wordpress_setup file, the problem still persists. Therefore the file mysql_randompw (and it's source) should be checked for anomalies.

The contents of /var/lib/update-rc.d/mysql is:
Code:
update-rc.d mysql defaults 19 21

The contents of /var/lib/update-rc.d/mysql_randompw is:
Code:
update-rc.d mysql_randompw start 20 2 .

The contents of /var/lib/update-rc.d/urandom is:
Code:
update-rc.d urandom start 55 S . start 30 0 6 .
 
Last edited:
Contents of the file:
# cat /etc/rc2.d/S01mysql_randompw
Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          mysql_randompw
# Required-Start:    $local_fs
# Required-Stop:
# X-Start-Before:    mysql
# Default-Start:     2
# Default-Stop:
# Short-Description: Generate random MySQL root password
# Description:       Generate and set a random MySQL root password
### END INIT INFO
set -e
HNAME=`head -n 1 /etc/hostname|awk '{ prin2t $1; }'`
if [ "X${HNAME}" = "Xlocalhost" ] ; then
    exit 0;
fi
# set HOME dir (for .my.cfg)
export HOME=/root
export USER=root
UPASSWD=`openssl rand -base64 9`
mysqladmin password "${UPASSWD}"
cat <<EOF  > /root/.my.cnf
[client]
user=root
password="${UPASSWD}"
EOF
chmod 0600 /root/.my.cnf
rm -f /etc/init.d/mysql_randompw
update-rc.d -f mysql_randompw remove
 
Code:
you run outdated packages, update and it should just works.

here are my package versions:

Code:
pve-manager: 1.8-17 (pve-manager/1.8/5948)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.8-33
pve-kernel-2.6.32-4-pve: 2.6.32-33
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.26-1pve4
vzdump: 1.2-12
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.14.0-3
ksm-control-daemon: 1.0-5

and:

Code:
dpkg -l dab
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  dab            1.1-14         Debian OpenVZ Appliance Builder
 
You're right Tom, I am using an older DAB.
Code:
# dpkg -l dab
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  dab            1.1-12         Debian OpenVZ Appliance Builder

The reason I tested it ths way is that a number of boxes with customised templates and tested build files (for application updates) have yet to be ported to the new dispensation. The use of the new DAB will entail the updation of the other dependencies for vz events and that will be done later.

For those yet to upgrade to the newest DAB and vz events, the template build files will have to ensure that the file /etc/rc6.d/S00vzreboot needs to be deleted for the newer build files insserv method to be used and ensure the PASSWD is replaced with UPASSWD in the firstboot setup script. On second boot, if any S01mysql_randompw error occurs in the logs, then the file at /etc/rc2.d/S01mysql_randompw (it should have been S21... and not S01...) should be removed and the random password be manually set with:

Code:
UPASSWD=`openssl rand -base64 9`
mysqladmin password "${UPASSWD}"
cat <<EOF  > /root/.my.cnf
[client]
user=root
password="${UPASSWD}"
EOF
chmod 0600 /root/.my.cnf

The newer DAB v1.1-14 sports a new mysql_randompw and it is made backwards compatible replacing the last lines of the older version:
Code:
rm -f /etc/init.d/mysql_randompw
update-rc.d -f mysql_randompw remove
with

Code:
if [ -x /sbin/insserv ] ; then
    /sbin/insserv -r mysql_randompw
    rm -f /etc/init.d/mysql_randompw
else
    rm -f /etc/init.d/mysql_randompw
    update-rc.d -f mysql_randompw remove
fi

I will now upgrade the DAB alone first and check if all is fine before upgrading the rest.
 
Last edited:
The following upgraded DAB v1.1-12 to 1.1-14:

# wget http://download.proxmox.com/debian/dists/lenny/pve/binary-amd64/dab_1.1-14_all.deb
Code:
--2011-05-20 19:15:57-- [URL]http://download.proxmox.com/debian/dists/lenny/pve/binary-amd64/dab_1.1-14_all.deb[/URL]
Resolving download.proxmox.com... 188.165.145.222
Connecting to download.proxmox.com|188.165.145.222|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27816 (27K) [application/x-debian-package]
Saving to: `dab_1.1-14_all.deb'
100%[======================================>] 27,816      40.2K/s   in 0.7s
2011-05-20 19:15:58 (40.2 KB/s) - `dab_1.1-14_all.deb' saved [27816/27816]
# dpkg -i dab_1.1-14_all.deb
Code:
(Reading database ... 26449 files and directories currently installed.)
Preparing to replace dab 1.1-12 (using dab_1.1-14_all.deb) ...
Unpacking replacement dab ...
Setting up dab (1.1-14) ...
Processing triggers for man-db ...
# dpkg -l dab
Code:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  dab            1.1-14         Debian OpenVZ Appliance Builder
 
The last part of the Wordpress template compilation under DAB v1.1-14 still has the S00vzreboot warning:
Code:
install: libjpeg62
install: php5-gd
install: php5
sed -e 's/^\s*display_errors\s*=\s*On/display_errors = Off/' -i /var/lib/vz/private/90000/etc/php5/apache2/php.ini
dab install php5-mysql
install: php5-mysql
tar xzf latest.tar.gz -C /var/lib/vz/private/90000/var/www/
# change owner, in order to enable web based updates
dab exec chown -R www-data.www-data /var/www/wordpress
install -m 0644 wordpress.conf /var/lib/vz/private/90000/etc/apache2/sites-available/wordpress
install -m 0755 wordpress_setup /var/lib/vz/private/90000/etc/init.d/
dab exec insserv wordpress_setup
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
dab exec a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
dab exec a2dissite default
Site default disabled.
Run '/etc/init.d/apache2 reload' to activate new configuration!
dab exec a2ensite wordpress
Enabling site wordpress.
Run '/etc/init.d/apache2 reload' to activate new configuration!
dab finalize
cleanup package status
update available package list
detecting final size: 490 MB
creating final appliance archive

The first boot logs of the newly created Wordpress Template using DAB v1.1-14 is clean and nice and shows:
Code:
INIT LOGOnline
starting init logger
INIT: version 2.88 booting 
stty: standard input: Invalid argument
Using makefile-style concurrent boot in runlevel S.
Activating swap...done.
mount: permission denied
Cleaning up ifupdown....
Setting up networking....
Fast boot enabled, so skipping file system check. ... (warning).
Mounting local filesystems...done.
Activating swapfile swap...done.
Cleaning up temporary files....
Configuring network interfaces...done.
Starting portmap daemon....
Cleaning up temporary files....
Setting kernel variables ...done.
INIT: Entering runlevel: 2 
stty: standard input: Invalid argument
Using makefile-style concurrent boot in runlevel 2.
Starting portmap daemon...Already running..
Starting enhanced syslogd: rsyslogd.
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
Generate random MySQL root password
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
Starting Postfix Mail Transport Agent: postfix.
generating ssh host keys
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
Starting OpenBSD Secure Shell server: sshd.
Generate Wordpress Siteconfig
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
Starting web server: apache2.
INIT: no more processes left in this runlevel
 
In a freshly created container (using the newly created Wordpress Template) before strting it, even if we delete the file:

/var/lib/vz/private/#VMID/etc/rc6.d/S00vzreboot

it gets recreated on first boot.

If we then delete it again, it does not get recreated from second boot onwards.

What program creates the said file on first boot?
 
again, works here. check if you got the latest version of all files (dab and pveversion -v).
 
Excellent. On upgrading to the latest versions all is fine and no errors / warning arise on account of S00vzreboot anymore.

The last part of the WordPress template compile now shows:
Code:
install: libjpeg62
install: php5-gd
install: php5
sed -e 's/^\s*display_errors\s*=\s*On/display_errors = Off/' -i /var/lib/vz/private/90000/etc/php5/apache2/php.ini
dab install php5-mysql
install: php5-mysql
tar xzf latest.tar.gz -C /var/lib/vz/private/90000/var/www/
# change owner, in order to enable web based updates
dab exec chown -R www-data.www-data /var/www/wordpress
install -m 0644 wordpress.conf /var/lib/vz/private/90000/etc/apache2/sites-available/wordpress
install -m 0755 wordpress_setup /var/lib/vz/private/90000/etc/init.d/
dab exec insserv wordpress_setup
dab exec a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!
dab exec a2dissite default
Site default disabled.
Run '/etc/init.d/apache2 reload' to activate new configuration!
dab exec a2ensite wordpress
Enabling site wordpress.
Run '/etc/init.d/apache2 reload' to activate new configuration!
dab finalize
cleanup package status
update available package list
detecting final size: 490 MB
creating final appliance archive

ls /var/lib/vz/private/90000/etc/rc2.d
Code:
README S14rsyslog S15ssh S18apache2
S01bootlogs S15atd S16mysql_randompw S19rc.local
S01ssh_gen_host_keys S15cron S16postfix S19rmnologin
S12portmap S15mysql S17wordpress_setup S19stop-bootlogd
# pveversion -v
Code:
pve-manager: 1.8-17 (pve-manager/1.8/5948)
running kernel: 2.6.32-4-pve
proxmox-ve-2.6.32: 1.8-33
pve-kernel-2.6.32-4-pve: 2.6.32-33
qemu-server: 1.1-30
pve-firmware: 1.0-11
libpve-storage-perl: 1.0-17
vncterm: 0.9-2
vzctl: 3.0.26-1pve4
vzdump: 1.2-12
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.14.0-3
ksm-control-daemon: 1.0-5