dab task mysql clarification

Discussion in 'Debian Appliance Builder' started by apmuthu, Dec 15, 2010.

  1. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    Earlier we used
    Code:
    dab task mysql --password random
    Now should it be:
    Code:
    dab task mysql --password=random
    ??

    A clarification with example in the man dab would be useful.
     
  2. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    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.
     
    #2 apmuthu, Dec 15, 2010
    Last edited: Dec 15, 2010
  3. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    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.
     
  4. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    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.
     
  5. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,461
    Likes Received:
    311
    Why - does it produce errors the way we do it now?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    I am always getting an error in executing the mysql_randompw under insserv for squeeze based DAB templates.
     
  7. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    Back to the first post in this thread - which is the preferred / correct way?
     
  8. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,461
    Likes Received:
    311
    AFAIK Getopt::Long supports both ways.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. apmuthu

    apmuthu Member

    Joined:
    Feb 26, 2009
    Messages:
    744
    Likes Received:
    3
    Thanks Dietmar.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice