Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29046

CLI installer did not using install/distrolib.php

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2, 2.3
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide

      Note: This requires separate testing for 21_STABLE and (22_STABLE or master). The patch in 21 is slightly different from the 22/master ones that are 100% equivalent.

      1/ create custom distro lib file (see 5 comments below or attached example).
      2/ try CLI install
      3/ verify that the settings specified in the distrolib are used.

      Show
      Note: This requires separate testing for 21_STABLE and (22_STABLE or master). The patch in 21 is slightly different from the 22/master ones that are 100% equivalent. 1/ create custom distro lib file (see 5 comments below or attached example). 2/ try CLI install 3/ verify that the settings specified in the distrolib are used.
    • Workaround:
      Show
      See brunch ALT/moodle2.2/patch/cli-install-distrolib ( http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=shortlog;h=refs/heads/ALT/moodle2.2/patch/cli-install-distrolib ) in my git repository.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w02_MDL-29046_m23_clidistrolib

      Description

      CLI installer does not use the defaults defined in the file install/distrolib.php.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            solo Aleksey Avdeev added a comment -

            Package moodle2.0-2.0.4.20110817-alt2 (see http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=commit;h=577e19f81f9432da3a0bf59c9db65c859e6a15c9) and moodle2.1-2.1.1.20110817-alt2 (see http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=commit;h=953323f83fae05a59eb2014524b0fb71cb78cfb9), applying the proposed patch (under the name of moodle-alt-cli-install-distrolib.patch), went to the Sisyphus (see http://en.altlinux.org/Sisyphus).

            Show
            solo Aleksey Avdeev added a comment - Package moodle2.0-2.0.4.20110817-alt2 (see http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=commit;h=577e19f81f9432da3a0bf59c9db65c859e6a15c9 ) and moodle2.1-2.1.1.20110817-alt2 (see http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=commit;h=953323f83fae05a59eb2014524b0fb71cb78cfb9 ), applying the proposed patch (under the name of moodle-alt-cli-install-distrolib.patch), went to the Sisyphus (see http://en.altlinux.org/Sisyphus ).
            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for reporting that and providing a solution.

            Show
            salvetore Michael de Raadt added a comment - Thanks for reporting that and providing a solution.
            Hide
            skodak Petr Skoda added a comment -

            Thanks a lot for the report and patch, I have submitted it for integration.

            Show
            skodak Petr Skoda added a comment - Thanks a lot for the report and patch, I have submitted it for integration.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Thanks for the patch, Aleksey and for sending it to integration, Petr.

            This is not applying clean due to some recent changes (in 2.2/master at least) related to dataroot handling. Please fix them.

            Also, note we are not supporting 2.0.x anymore, so this won't be applied to that branch.

            Finally, please, complete testing instructions a bit by pointing to documentation about how to prepare one distrolib file / attaching one. Testers are not expected to know that.

            I'll keep this open for some time. Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Thanks for the patch, Aleksey and for sending it to integration, Petr. This is not applying clean due to some recent changes (in 2.2/master at least) related to dataroot handling. Please fix them. Also, note we are not supporting 2.0.x anymore, so this won't be applied to that branch. Finally, please, complete testing instructions a bit by pointing to documentation about how to prepare one distrolib file / attaching one. Testers are not expected to know that. I'll keep this open for some time. Ciao
            Hide
            skodak Petr Skoda added a comment -

            fixing in my my new branch, thanks

            Show
            skodak Petr Skoda added a comment - fixing in my my new branch, thanks
            Hide
            skodak Petr Skoda added a comment - - edited

            sample distro file '/lib/distrolib.php'

            <?php
             
            function distro_get_config() {
                $config = new stdClass();
                $config->dbtype = 'mysqli';
                $config->dbhost = '127.0.0.1';
                $config->directorypermissions = 0777;
             
                return $config;
            }

            Show
            skodak Petr Skoda added a comment - - edited sample distro file '/lib/distrolib.php' <?php   function distro_get_config() { $config = new stdClass(); $config->dbtype = 'mysqli'; $config->dbhost = '127.0.0.1'; $config->directorypermissions = 0777;   return $config; }
            Hide
            skodak Petr Skoda added a comment -

            pull link updated

            Show
            skodak Petr Skoda added a comment - pull link updated
            Hide
            skodak Petr Skoda added a comment -

            to integrator: please cherry pick to 2.2.x

            Show
            skodak Petr Skoda added a comment - to integrator: please cherry pick to 2.2.x
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Sorry, Petr, any reason for not having this backported to 21_STABLE ? As a bug it should be IMO.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Sorry, Petr, any reason for not having this backported to 21_STABLE ? As a bug it should be IMO.
            Hide
            skodak Petr Skoda added a comment -

            Hi, I viewed it more like a new feature. In case of web interface installer you have no way to pass default parameters, but in case of CLI you may launch it with params, maybe we should not integrate this at all, what do you think?

            Show
            skodak Petr Skoda added a comment - Hi, I viewed it more like a new feature. In case of web interface installer you have no way to pass default parameters, but in case of CLI you may launch it with params, maybe we should not integrate this at all, what do you think?
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Well, perhaps Aleksey could give us some light about the use case beyond implementing this. I'm unable to imagine under which situation distrolib is better than explicit params already present in the CLI installer.

            Perhaps database creation is the difference, with distrolib supporting it and CLI not being able to do so?

            I'll keep this open for 1 more week to have time to get feedback & opinions... ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Well, perhaps Aleksey could give us some light about the use case beyond implementing this. I'm unable to imagine under which situation distrolib is better than explicit params already present in the CLI installer. Perhaps database creation is the difference, with distrolib supporting it and CLI not being able to do so? I'll keep this open for 1 more week to have time to get feedback & opinions... ciao
            Hide
            skodak Petr Skoda added a comment -

            yes, the db creation if the biggest difference, +1 for the 1w delay

            Show
            skodak Petr Skoda added a comment - yes, the db creation if the biggest difference, +1 for the 1w delay
            Hide
            solo Aleksey Avdeev added a comment - - edited

            We in the ALT Linux distribution for moodle uses several non-traditional setting:

            • /var/lib/moodle for dataroot, at the location of the moodle in /var/www/webapps/moodle.
            • 02770 for directorypermissions_webserver group should be able to write, because I don `t know beforehand what kind of webserver presentedin distibutive will be used. And i do not need to have to change it (webserver) in the operation of moodle. (Each webserver runs as a pseudo user, but they all belong to the group _webserver.)

            About the data specific to the ALT Linux distro default, the user does not have to know the distribution. Running any of the installers and agreeing with all the default (user) should get a working moodle. Therefore relevant to the distribution of silence, I must ask. And I, it is important chtoyuy I could do it in one place.

            PS: If the user changes the dataroot or directorypermissions – I think that he knows what he's doing.

            Show
            solo Aleksey Avdeev added a comment - - edited We in the ALT Linux distribution for moodle uses several non-traditional setting: /var/lib/moodle for dataroot , at the location of the moodle in /var/www/webapps/moodle . 02770 for directorypermissions – _webserver group should be able to write, because I don `t know beforehand what kind of webserver presentedin distibutive will be used. And i do not need to have to change it (webserver) in the operation of moodle. (Each webserver runs as a pseudo user, but they all belong to the group _webserver .) About the data specific to the ALT Linux distro default, the user does not have to know the distribution. Running any of the installers and agreeing with all the default (user) should get a working moodle. Therefore relevant to the distribution of silence, I must ask. And I, it is important chtoyuy I could do it in one place. PS: If the user changes the dataroot or directorypermissions – I think that he knows what he's doing.
            Show
            solo Aleksey Avdeev added a comment - File distrolib.php , placed in moodle2 .*. rpm in ALT Linux (see, http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=blob;f=distrolib.php;h=87055cda70375e5c535dae50f5ff63cc0efe10de;hb=66933dc2366c2cede2c2f805d6396f2492ad3fcd ).
            Hide
            skodak Petr Skoda added a comment -

            Thanks a lot Aleksay, this is imho one of the expected usages of distrolib.

            Show
            skodak Petr Skoda added a comment - Thanks a lot Aleksay, this is imho one of the expected usages of distrolib.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks!

            Finally, I've also integrated the fix for 21_STABLE from:

            http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=commitdiff;h=33da5a0bcde02f1edf9d6ebecd040e84e446db04

            Not possible to apply to 20_STABLE, because it's out of support and not accepting general issues anymore.

            Thanks Aleksey & Petr!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! Finally, I've also integrated the fix for 21_STABLE from: http://git.altlinux.org/people/solo/packages/moodle.git?p=moodle.git;a=commitdiff;h=33da5a0bcde02f1edf9d6ebecd040e84e446db04 Not possible to apply to 20_STABLE, because it's out of support and not accepting general issues anymore. Thanks Aleksey & Petr!
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Tested and passed thanks Petr, had to look up the things that can be set in distrolib as not everything is of course.

            Cheers
            Sam

            Show
            samhemelryk Sam Hemelryk added a comment - Tested and passed thanks Petr, had to look up the things that can be set in distrolib as not everything is of course. Cheers Sam
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            This virus has been spread upstream, everybody will be infected soon. Congrats, you did it!

            Closing, ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - This virus has been spread upstream, everybody will be infected soon. Congrats, you did it! Closing, ciao

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12