• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Updating installer scripts to reflect both locations of mysql password

    Scheduled Pinned Locked Moved Solved
    Bug Reports
    4
    10
    4.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chad-bisd Moderator
      last edited by

      I checked [URL=‘http://freeghost.svn.sourceforge.net/viewvc/freeghost/trunk/’]trunk [/URL] [URL=‘http://freeghost.svn.sourceforge.net/viewvc/freeghost/trunk/lib/’] > lib [/URL] [URL=‘http://freeghost.svn.sourceforge.net/viewvc/freeghost/trunk/lib/ubuntu/’] > ubuntu [/URL] > functions.sh (861). The installPackages() function still only echos out a note about updating the config file under ${webdirdest}/commons/config.php and mentions nothing about /opt/fog/service/etc/config.php.

      iirc, both locations must be updated if you use a non-empty root password in mysql. The first for the web ui, the second for the FOGImageReplicator service.


      If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

      1 Reply Last reply Reply Quote 0
      • A
        afmrick
        last edited by

        Yeah, it would be so easy to fix:

        Original fog_0.32/lib/ubuntu/functions.sh (with line numbers shown):
        [CODE] 459 define( “MYSQL_HOST”, “localhost” );
        460 define( “MYSQL_DATABASE”, “fog” );
        461 define( “MYSQL_USERNAME”, “root” );
        462 define( “MYSQL_PASSWORD”, “” );[/CODE]

        Fixed fog_0.32/lib/ubuntu/functions.sh (with line numbers shown):
        [CODE] 459 define( “MYSQL_HOST”, “${snmysqlhost}” );
        460 define( “MYSQL_DATABASE”, “fog” );
        461 define( “MYSQL_USERNAME”, “${snmysqluser}” );
        462 define( “MYSQL_PASSWORD”, “${snmysqlpass}” );[/CODE]
        …or something like that. I haven’t checked to make absolutely sure that those variables are defined when the configureHttpd() function s is called during install.

        The same change should be made for fog_0.32/lib/redhat/functions.sh only on lines 433-436.

        Can we submit a diff or anything to fix this? …Assuming it’s not fixed in 0.33 when it comes out.

        1 Reply Last reply Reply Quote 0
        • C
          chad-bisd Moderator
          last edited by

          The installer currently warns you that if you set the mysql password for the root user to a non-empty value, that you must update the /var/www/fog/commons/config.php file, when in reality, you have to modify the /opt/fog/service/etc/config.php ALSO.

          I want to make Fog easier to use in general and adding an additional note to the install script should be easy before 0.33 is released.

          If at some point in the future the installer can update the config files for you, we’ll be even closer to perfection.


          If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

          1 Reply Last reply Reply Quote 0
          • A
            afmrick
            last edited by

            Ah, you didn’t want the script to update both config files - you just wanted a better warning.
            You could change the following in fog_0.32/lib/ubuntu/functions.sh with whatever sounds good to you:
            [CODE] 542 echo " We are about to install MySQL Server on “;
            543 echo " this server, if MySQL isn’t installed already”;
            544 echo " you will be prompted for a root password. If";
            545 echo " you don’t leave it blank you will need to change";
            546 echo " it in the config.php file located at:";
            547 echo " “;
            548 echo " ${webdirdest}/commons/config.php”;[/CODE]
            Say, change “file” to “files” in line 546 insert another line below 548 listing the second config file.

            …Although, it looks like the install script is supposed to update /opt/fog/service/etc/config.php so, in truth the only config file you have to update manually during install is ${webdirdest}/commons/config.php. So, the message is correct - it just would be better, IMO, if the script updated both files (or neither I suppose).

            1 Reply Last reply Reply Quote 0
            • C
              chad-bisd Moderator
              last edited by

              I didn’t look through the code enough to figure out if it already tries to update the /opt/fog/service/etc/config.php file with the mysql root password. I kind of assumed that the installer doesn’t know what the password is, at least on Ubuntu because the installer prompts you for it when you install the mysql packages.

              I had to change an existing server to have a password on the mysql root user account, and had to scour the wiki, forums, and google to find both locations it’s needed.


              If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

              1 Reply Last reply Reply Quote 0
              • B
                Blackout Developer
                last edited by

                The installer scripts need to be updated to ask for MySQL passwords and then put them in the correct location.

                If anyone could help, please PM me. You must be capable of modifying BASH scripts and comfortable working in Linux.

                1 Reply Last reply Reply Quote 0
                • A
                  afmrick
                  last edited by

                  I’d love to volunteer FWIW but, I work for a University where we are not allowed to contribute to GPLv3 projects. 😞
                  We can only file bug reports and snippets of code.

                  1 Reply Last reply Reply Quote 0
                  • C
                    chad-bisd Moderator
                    last edited by

                    I am familiar enough with BASH and Linux. I can update the installer scripts. I’ll grab the latest off SVN through sourceforge and generate a patch file. Does that sound like a good plan?


                    If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

                    1 Reply Last reply Reply Quote 0
                    • C
                      chad-bisd Moderator
                      last edited by

                      For Ubuntu:
                      What does everyone think about adding debconf-utils to the Ubuntu packages, using the install script to prompt for a password, and then using debconf-set-selections to tell mysql what the default root password should be so it doesn’t do a separate prompt? We could then use that saved value to update the config files as needed.

                      I’m looking at the 0.33 code as of revision 898 and it doesn’t look like much has changed in regards to this item. Can someone look at the code under the /lib/commons and /lib/ubuntu and double check that this is what would be needed?

                      For RedHat:
                      It looks like the redhat package installs with no password and you can run a mysqladmin command later to set it using the value read in from the prompt in the /lib/common/input.sh


                      If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

                      1 Reply Last reply Reply Quote 0
                      • Tom ElliottT
                        Tom Elliott
                        last edited by

                        While old, I think it’s worth mentioning here if only for documentary purposes.

                        The /opt/fog/service/etc/config.php file now only contains a pointer to the FOG Servers FOG Web GUI information. This means what’s stored in the commons/config.php is the same info used for the FOG Service files. I’ve made great strides in adding the relevant sql questions and updating the information as well and believe it’s fairly safe to close this particular bug as resolved.

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post

                        293

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project