Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moodle: init at 3.7.1 #63634

Merged
merged 2 commits into from Aug 27, 2019
Merged

moodle: init at 3.7.1 #63634

merged 2 commits into from Aug 27, 2019

Conversation

aanderse
Copy link
Member

@aanderse aanderse commented Jun 21, 2019

Motivation for this change

https://discourse.nixos.org/t/writing-my-own-local-httpd-subservice/3194

Things not yet done but need to be before merged
  • Find a maintainer so meta can be completed in the package
  • Testing by someone who actually knows how to use moodle
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/writing-my-own-local-httpd-subservice/3194/3

nixos/modules/services/web-apps/moodle.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/moodle.nix Show resolved Hide resolved
@aanderse
Copy link
Member Author

Thanks @JohnAZoidberg. I always appreciate review catching the little things 😄 As mentioned, revisions to come.

@aanderse aanderse force-pushed the moodle branch 2 times, most recently from e0244f7 to 101bb9b Compare June 25, 2019 02:05
@pmiddend
Copy link
Contributor

Okay, I've had time to test this using the instructions you provided on discourse. My configuration is as minimal as can be:

services.moodle = {
  enable = true;
  initialPassword = "foobar";    
  virtualHost = {
    hostName = "moodle.example.org";
    enableSSL = false;
    adminAddr = "webmaster@example.org";
  };
};

This results in the following error:

Jun 27 12:50:14 hypnos systemd[1]: Starting moodle-init.service...
Jun 27 12:50:14 hypnos ainriknxqms310gm3k19d7bzca3vznj4-unit-script-moodle-init-start[21008]: !!! <p>Error: Database connection failed</p>
Jun 27 12:50:14 hypnos ainriknxqms310gm3k19d7bzca3vznj4-unit-script-moodle-init-start[21008]: <p>It is possible that the database is overloaded or otherwise not running properly.</p>
Jun 27 12:50:14 hypnos ainriknxqms310gm3k19d7bzca3vznj4-unit-script-moodle-init-start[21008]: <p>The site administrator should also check that the database details have been correctly specified in config.php</p> !!!
Jun 27 12:50:14 hypnos ainriknxqms310gm3k19d7bzca3vznj4-unit-script-moodle-init-start[21008]: !!! <p>Error: Database connection failed</p>
Jun 27 12:50:14 hypnos ainriknxqms310gm3k19d7bzca3vznj4-unit-script-moodle-init-start[21008]: <p>It is possible that the database is overloaded or otherwise not running properly.</p>
Jun 27 12:50:14 hypnos ainriknxqms310gm3k19d7bzca3vznj4-unit-script-moodle-init-start[21008]: <p>The site administrator should also check that the database details have been correctly specified in config.php</p> !!!
Jun 27 12:50:14 hypnos systemd[1]: moodle-init.service: Main process exited, code=exited, status=1/FAILURE
Jun 27 12:50:14 hypnos systemd[1]: moodle-init.service: Failed with result 'exit-code'.
Jun 27 12:50:14 hypnos systemd[1]: Failed to start moodle-init.service.

● mysql.service - MySQL Server
   Loaded: loaded (/nix/store/0d5ni4q3w0mbkx0dq3r3szqzxzrqch29-unit-mysql.service/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-06-27 12:50:14 CEST; 628ms ago
  Process: 20967 ExecStartPre=/nix/store/4yvyv354mckk037gx1dgpmydy3pw56b3-unit-script-mysql-pre-start (code=exited, status=0/SUCCESS)
  Process: 20971 ExecStart=/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/bin/mysqld --defaults-file=/etc/my.cnf --user=mysql --datadir=/var/lib/mysql --basedir=/nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15 $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 21003 ExecStartPost=/nix/store/gfcwg0a59mz1pmd0ly32ml7ggadaqyqk-unit-script-mysql-post-start (code=exited, status=1/FAILURE)
 Main PID: 20971 (code=exited, status=0/SUCCESS)
   Status: "MariaDB server is down"

Jun 27 12:50:12 hypnos mysqld[20971]: 2019-06-27 12:50:12 0 [Note] /nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/bin/mysqld (initiated by: unknown): Normal shutdown
Jun 27 12:50:12 hypnos mysqld[20971]: 2019-06-27 12:50:12 0 [Note] InnoDB: FTS optimize thread exiting.
Jun 27 12:50:12 hypnos mysqld[20971]: 2019-06-27 12:50:12 0 [Note] InnoDB: Starting shutdown...
Jun 27 12:50:12 hypnos mysqld[20971]: 2019-06-27 12:50:12 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
Jun 27 12:50:12 hypnos mysqld[20971]: 2019-06-27 12:50:12 0 [Note] InnoDB: Buffer pool(s) dump completed at 190627 12:50:12
Jun 27 12:50:14 hypnos mysqld[20971]: 2019-06-27 12:50:14 0 [Note] InnoDB: Shutdown completed; log sequence number 2217442853; transaction id 6818308
Jun 27 12:50:14 hypnos mysqld[20971]: 2019-06-27 12:50:14 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
Jun 27 12:50:14 hypnos mysqld[20971]: 2019-06-27 12:50:14 0 [Note] /nix/store/63l1lwz19lj4mw03m2ra7m1vnylp8xxl-mariadb-10.3.15/bin/mysqld: Shutdown complete
Jun 27 12:50:14 hypnos systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 27 12:50:14 hypnos systemd[1]: Failed to start MySQL Server.
warning: error(s) occurred while switching to the new configuration

Is there anything missing or something I did wrong? Sorry if it's something trivial.

@aanderse
Copy link
Member Author

aanderse commented Jun 27, 2019

@pmiddend seems to be a issue with the mysql service potentially unrelated to moodle. Are you running a mysql database on your system? Abby mention in your configuration.nix? Please post output of sudo journalctl -r -u mysql.service.

EDIT: Have you by chance secured your mysql installation? If so this is an unrelated bug in master I have an upcoming PR to fix. More details to come.

@aanderse
Copy link
Member Author

aanderse commented Jul 1, 2019

@pmiddend the mysql issue has been resolved so if you update your OS to the latest nixpkgs unstable and run again everything should work. I have taken the liberty of adding you as the package maintainer. I hope that is acceptable to you. Please let me know when you get a chance to test.

@aanderse
Copy link
Member Author

aanderse commented Jul 1, 2019

@GrahamcOfBorg test moodle

@pmiddend
Copy link
Contributor

pmiddend commented Jul 2, 2019

@aanderse Sorry for leaving you hanging like this. I'm a little busy currently. I think I'll have time this week to test.
Also, could you remove me as the maintainer? It's not clear that I'll actually be using moodle in conjunction with NixOS, so maintaining the package doesn't make sense to me.

@aanderse
Copy link
Member Author

aanderse commented Jul 3, 2019

@pmiddend My apologies for adding you as the maintainer. A bit presumptuous of me.
There was another issue in master which was causing breakage on this module that has been fixed. Please update your channel sometime after the next channel advance and then this module should run for you.

@pmiddend
Copy link
Contributor

pmiddend commented Jul 8, 2019

@aanderse Don't worry about the maintainer status. :)
I'm currently sort of stuck with #63829 so I haven't had a chance to fully test this.

@aanderse aanderse changed the title moodle: init at 3.7 moodle: init at 3.7.1 Jul 11, 2019
@aanderse
Copy link
Member Author

Test takes a while but runs successfully on my machine.

@aanderse aanderse merged commit 87fdc06 into NixOS:master Aug 27, 2019
@aanderse aanderse deleted the moodle branch August 27, 2019 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants