dab task mysql clarification

apmuthu

Member
Feb 26, 2009
744
3
18
Chennai - India & Singapore
Please verify whether the line 1576 in /usr/share/perl5/PVE/DAB.pm (in dab v1.1.9) is valid.
It currently states:
Code:
    my $rpw = $password eq 'random' ? 'admin' : $password;
<del>This is possibly wrongly inverted</del>.
It appears that a script is inited - mysql_randompw - so that it is generated to be a 9 character random string at creation time of container.

At line 26 of the /etc/init.d/mysql_randompw , the mysqladmin statement is invoked - at this stage in the DAB.pm at line 1585 where it is called from. Only subsequently in DAB.pm at line 1589 is the mysql started.

Line 1496 of DAB.pm however uses
Code:
/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables
and can hence successfully evaluate the SQLs at lines 1569 and 1578 possibly without the mysql being explicitly started.

Therefore, line 1589 should precede line 1584, ie., mysql must be started just after the /root/.my.cnf file has been written.
 
Last edited:

apmuthu

Member
Feb 26, 2009
744
3
18
Chennai - India & Singapore
The above is because the mysql_randompw script is wrongly placed in priority 01 instead of the intended priority 20 at runlevel 2. No change needs to be done in the lines 1584 and 1589.
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
16,529
328
103
Austria
www.proxmox.com
Should the last 2 lines of /usr/lib/dab/scripts/mysql_randompw be reversed? - First remove the symlink using the update-rc.d statement and then remove the file itself.
Why - does it produce errors the way we do it now?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!