summaryrefslogtreecommitdiff
path: root/gnu/services/databases.scm
AgeCommit message (Collapse)Author
2024-03-30services: postgresql: Simplify execution of ‘initdb’.Ludovic Courtès
* gnu/services/databases.scm (postgresql-activation): Replace ‘primitive-exit’ + ‘system*’ with ‘execl’. Change-Id: I491fd3093f67af59f240438d7d6123e769e4ec1e
2024-03-30services: postgresql: Don't initdb when directory exists.Robert Vollmert
* gnu/services/databases.scm (postgresql-activation): Check if directory exists. Reviewed-by: Dale Mellor <guix-devel-0brg6b@rdmp.org> Signed-off-by: Ludovic Courtès <ludo@gnu.org> Change-Id: Id563a3e8df2cb5b805e64cd8319303c65d308c69
2023-12-22services: Remove unnecessary references to (gnu build shepherd).Ludovic Courtès
* gnu/services/databases.scm (memcached-shepherd-service): Remove ‘with-imported-modules’ form and ‘modules’ field. * gnu/services/security-token.scm (pcscd-shepherd-service): Remove ‘with-imported-modules’ form. * gnu/services/web.scm (hpcguix-web-shepherd-service): Likewise. Change-Id: Ieb817508f1751e0c1ff551a0e078789a4a813c1c
2023-08-16services: posgresql: Add option to specify UID/GID for postgres user.Martin Baulig
Add 'createAccount?', 'uid' and 'gid' to <postgresql-configuation>. Unlike other system daemons, the PostgreSQL data directory is typically meant to persist across 'guix system reconfigure' and once created, you don't want it's UID or GID to change anymore. Furthermore, if you want to place the data directory on a network share and use NFSv4 with idmap, then the 'postgres' user must exist when the 'rpc.idmapd' daemon is launched; prior to mounting the share. And it needs to be possible to mount the share without configuring PostgreSQL. With NFSv3, the UID and GID typically needs to match those on the server. The added options allow for both of these scenarios: You can either create the user in (operating-system (users)) completely independently of the 'postgresql-service-type' (for instance to get your NFS setup working first prior to configuring your databases) - or "pin" it's UID / GID values. * gnu/services/databases.scm (<postgresql-configuration>)[create-account?] [uid, gid]: New fields. (%postgresql-accounts): Remove. (create-postgresql-account): New procedure. (postgresql-service-type)[extensions]: Use it. * doc/guix.texi (Database Services): Update accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-08-11services: postgresql: Add more role fields.Miguel Moreno
* gnu/services/databases.scm (postgresql-role): Add more role fields. (postgresql-create-roles): Honor it. * doc/guix.texi (Database Services): Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-04-21services: postgresql: Add default package.Ludovic Courtès
* gnu/services/databases.scm (<postgresql-configuration>)[postgresql]: Add default value, moved from... (postgresql-service-type)[default-value]: ... here.
2023-04-21services: redis: Add 'configuration' action.Ludovic Courtès
* gnu/services/databases.scm (redis-shepherd-service): Add 'actions' field.
2023-04-21services: mysql: Add 'configuration' action.Ludovic Courtès
* gnu/services/databases.scm (mysql-shepherd-service): Add 'actions' field.
2023-04-21services: postgresql: Add 'configuration' action.Ludovic Courtès
* gnu/services/databases.scm (postgresql-shepherd-service): Add 'actions' field.
2023-04-21services: postgresql: Add the 'postgresql' Shepherd service name.Ludovic Courtès
* gnu/services/databases.scm (postgresql-shepherd-service): Add 'postgresql' to 'provision'.
2022-11-20services: mysql: Run mariadb-install-db instead of hard coding schemas.Marius Bakke
* gnu/services/databases.scm (mysql-install): Run "mariadb-install-db" instead of a hard coded set of SQL commands. (mysql-upgrade-wrapper): Explicitly run as mysql user.
2022-11-20services: mysql: Remove mysql-install-service in favor of wrapper.Marius Bakke
* gnu/services/databases.scm (mysql-with-install-lock): Remove variable. (mysql-start): Rename to ... (mysqld-wrapper): ... this. Do the preliminary initialization steps and call out to MYSQL-INSTALL when necessary. (mysql-install): Only initialize table schemas. (mysql-install-shepherd-service): Remove. (mysql-service)[requirement]: Remove 'mysql-install. Add 'user-processes. [start]: Don't pass #:user and #:group. (mysql-shepherd-services): Remove MYSQL-INSTALL-SHEPHERD-SERVICE.
2022-11-20services: mysql-upgrade: Add log file.Marius Bakke
* gnu/services/databases.scm (mysql-upgrade-shepherd-service)[start]: Pass #:log-file.
2022-11-20services: mysql-upgrade: Support custom datadir.Marius Bakke
* gnu/services/databases.scm (mysql-upgrade-wrapper): Take service configuration as argument, and pass the config file to mysql_upgrade. (mysql-upgrade-shepherd-service): Pass CONFIG instead of just socket and executable to MYSQL-UPGRADE-WRAPPER.
2022-11-20gnu: mysql: Support custom data dir.Ellen Papsch
* gnu/services/databases.scm (mysql-configuration): Add datadir property. * gnu/services/databases.scm (mysql-configuration-file): Replace hard coded data dir with property from config. * gnu/services/databases.scm (%mysql-activation): Remove activation, it runs before PID 1. The data dir may reside on a file system not mounted at this time. * gnu/services/databases.scm (mysql-install-shepherd-service): Create service which replaces the activation. Provide mysql-install. * gnu/services/databases.scm (mysql-shepherd-service): Move invocation of mysqld to mysql-start program-file, because the invocation gotten more complex. Require mysql-install. * gnu/services/databases.scm (mysql-start): Invoke mysqld only if a lock file appears. * gnu/services/databases.scm (mysql-shepherd-services): Prepend the install service before the normal service. * gnu/services/databases.scm (mysql-upgrade-wrapper): Increase timeout to 20s to let the mysql install procedure finish. Signed-off-by: Marius Bakke <marius@gnu.org>
2022-04-29services: Add missing 'description' fields.Ludovic Courtès
* gnu/services/databases.scm (postgresql-service-type)[description]: New field. (memcached-service-type)[description]: New field. (mysql-service-type)[description]: New field. (redis-service-type)[description]: New field. * gnu/services/desktop.scm (geoclue-service-type)[description]: New field. (udisks-service-type)[description]: New field. (elogind-service-type)[description]: New field. (account-service-type)[description]: New field. * gnu/services/kerberos.scm (krb5-service-type)[description]: New field. (pam-krb5-service-type)[description]: New field. * gnu/services/lirc.scm (lirc-service-type)[description]: New field. * gnu/services/mail.scm (dovecot-service-type)[description]: New field. (opensmtpd-service-type)[description]: New field. (mail-aliases-service-type)[description]: New field. (exim-service-type)[description]: New field. * gnu/services/monitoring.scm (zabbix-server-service-type)[description]: New field. (zabbix-agent-service-type)[description]: New field. * gnu/services/nfs.scm (rpcbind-service-type)[description]: New field. (pipefs-service-type)[description]: New field. (gss-service-type)[description]: New field. (idmap-service-type)[description]: New field. * gnu/services/spice.scm (spice-vdagent-service-type)[description]: New field. * gnu/services/sysctl.scm (sysctl-service-type)[description]: New field. * gnu/services/virtualization.scm (libvirt-service-type)[description]: New field. (virtlog-service-type)[description]: New field. * gnu/services/vpn.scm (openvpn-server-service-type)[description]: New field. (openvpn-client-service-type)[description]: New field. (wireguard-service-type)[description]: New field. * gnu/services/web.scm (httpd-service-type)[description]: New field. (fcgiwrap-service-type)[description]: New field. (agate-service-type)[description]: New field. [name]: Fix.
2022-01-29services: postgresql: Export missing <postgresql-configuration> accessor.Marius Bakke
* gnu/services/databases.scm: Export POSTGRESQL-CONFIGURATION-EXTENSION-PACKAGES.
2021-12-05Merge remote-tracking branch 'origin/master' into core-updates-frozenRicardo Wurmus
2021-11-30services: Accept <inferior-package>s in lieu of <package>s.Tobias Geerinckx-Rice
* gnu/services/authentication.scm (fprintd-configuration) (nslcd-configuration): Substitute file-like objects for package ones. * gnu/services/cgit.scm (cgit-configuration, opaque-cgit-configuration): Likewise. * gnu/services/cups.scm (package-list?, cups-configuration): Likewise. * gnu/services/dns.scm (verify-knot-configuration) (ddclient-configuration): Likewise. * gnu/services/docker.scm (docker-configuration): Likewise. * gnu/services/file-sharing.scm (transmission-daemon-configuration): Likewise. * gnu/services/getmail.scm (getmail-configuration): Likewise. * gnu/services/mail.scm (dovecot-configuration) (opaque-dovecot-configuration): Likewise. * gnu/services/messaging.scm (prosody-configuration) (opaque-prosody-configuration): Likewise. * gnu/services/monitoring.scm (zabbix-server-configuration) (zabbix-agent-configuration): Likewise. * gnu/services/networking.scm (opendht-configuration): Likewise. * gnu/services/pm.scm (tlp-configuration): Likewise. * gnu/services/telephony.scm (jami-configuration): Likewise. * gnu/services/virtualization.scm (libvirt-configuration) (qemu-guest-agent-configuration): Likewise. * gnu/services/vpn.scm (openvpn-client-configuration): Likewise.
2021-09-27services: database: Change postgresql default socket.Mathieu Othacehe
Adapt to the postgresql default socket directory set to /var/run/postgresql. * gnu/services/databases.scm (<postgresql-config-file>)[socket-directory]: Set to /var/run/postgresql. (<postgresql-role-configuration>): Ditto. * gnu/tests/databases.scm (run-postgresql-test): Adapt it.
2021-04-27services: mysql: Add extra-environment as configuration option.methuselah-0
* gnu/services/databases.scm (mysql-configuration): Add extra-environment (mysql-service): Use #:log-file and #:environment-variables * doc/guix.texi: Document it. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
2021-04-14Revert "services: mysql: Add extra-environment as configuration option."Leo Prikler
This reverts commit f3626119d738f30b5ab59e76c105fd7b4c077ddc. This commit inadvertently broke a string freeze. Let's be nice to our translators and not do that.
2021-04-13services: postgresql: Use "/tmp" host directory.Mathieu Othacehe
This is a follow-up of c311147bd16aa0e5746d9cbf31502f5fd61e470c. * gnu/services/databases.scm (<postgresql-role-configuration>)[host]: Set to "/tmp" which the default Postgresql socket directory.
2021-04-13services: mysql: Add extra-environment as configuration option.methuselah-0
* gnu/services/databases.scm (mysql-configuration): Add extra-environment (mysql-service): Use #:log-file and #:environment-variables * doc/guix.texi: Document it. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
2021-04-12services: postgresql: Change service default socket directory.Christopher Baines
Fixes <https://bugs.gnu.org/46737>. PostgreSQL running with a different socket directory to the default one in the package itself breaks some services, this commit restores the previous behaviour where PostgreSQL by default will run with a socket directory that matches the default used by PostgreSQL packaged for Guix. Switching to a different default value can happen, but only alongside changing the PostgreSQL package. * gnu/services/databases.scm (<postgresql-config-file>)[socket-directory]: Change default to #false. * doc/guix.texi (Database Services): Update documentation, and specify a different value for disabling connections via sockets. * gnu/tests/guix.scm (%guix-data-service-os): Use default PostgreSQL behaviour. * gnu/tests/monitoring.scm (%zabbix-os): Likewise. * gnu/tests/web.scm (patchwork-os): Likewise. Signed-off-by: Leo Famulari <leo@famulari.name>
2021-03-16gnu: Remove MongoDB.Léo Le Bouter
mongodb 3.4.10 has unpatched CVEs and mongodb 3.4.24 has some files in the release tarball under the SSPL, therefore we cannot provide mongodb while upholding to good security standards. It turns out feff80cec3c97a3df2c20d300be12d67f79d4f22 was right since while the main license file wasnt altered to SSPL, some files in the tree contain SSPL headers. * gnu/packages/databases.scm (go-gopkg.in-mgo.v2): Remove. * gnu/packages/databases.scm (mongo-tools): Remove. * doc/guix.texi (mongodb-service-type): Remove. * gnu/tests/databases.scm (%test-mongodb, %mongodb-os, run-mongodb-test): Remove. * gnu/services/databases.scm (mongodb-configuration, mongodb-configuration?, mongodb-configuration-mongodb, mongodb-configuration-config-file, mongodb-configuration-data-directory, mongodb-service-type, %default-mongodb-configuration-file, %mongodb-accounts, mongodb-activation, mongodb-shepherd-service): Remove. * gnu/packages/databases.scm (mongodb): Remove.
2021-02-23services: postgresql-roles: Fix race condition.Mathieu Othacehe
Make sure that the postgresql-roles script is completed before declaring the postgresql-roles service as started. * gnu/services/databases.scm (postgresql-create-roles): Return the command line instead of a program-file. (postgresql-role-shepherd-service): Use fork+exec-command to start the role creation script and wait for its completion before returning.
2021-02-22services: postgresql: Define a default value.Mathieu Othacehe
* gnu/services/databases.scm (postgresql-service-type): Define a default value.
2021-02-06services: PostgreSQL: Quote database names.Marius Bakke
* gnu/services/databases.scm (postgresql-create-roles): Quote the name in the SQL query so that roles/usernames containing hyphens will work.
2021-01-28services: postgresql: Add postgresql-role-service-type.Mathieu Othacehe
* gnu/services/databases.scm (postgresql-role, postgresql-role?, postgresql-role-name, postgresql-role-permissions, postgresql-role-create-database?, postgresql-role-configuration, postgresql-role-configuration?, postgresql-role-configuration-host, postgresql-role-configuration-roles, postgresql-role-service-type): New procedures. * gnu/tests/databases.scm: Test it. * doc/guix.texi: Document it.
2021-01-28services: postgresql: Wrap long lines.Mathieu Othacehe
* gnu/services/databases.scm: Wrap long lines, no functional change.
2021-01-28services: postgresql: Add log directory support.Mathieu Othacehe
* gnu/services/databases.scm (postgresql-configuration-log-directory): New procedure. (<postgresql-configuration>)[log-directory]: New field. (postgresql-activation): Create the log directory. (postgresql-shepherd-service): Honor it. * gnu/tests/databases.scm (%postgresql-log-directory): New variable. (log-file): New test case. * doc/guix.texi (Database Services): Document it.
2021-01-28services: postgresql: Add socket directory support.Mathieu Othacehe
* gnu/services/databases.scm (postgresql-config-file-socket-directory): New procedure. (<postgresql-config-file>)[socket-directory]: New field. (postgresql-config-file-compiler): Honor it. (postgresql-activation): Create the socket directory if needed. * doc/guix.texi (Database Services): Document it. * gnu/tests/guix.scm (%guix-data-service-os): Adapt it. * gnu/tests/monitoring.scm (%zabbix-os): Ditto. * gnu/tests/web.scm (patchwork-os): Ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-01-28services: postgresql: Use Guile datatypes.Mathieu Othacehe
* gnu/services/databases.scm (postgresql-config-file-compiler): Support Guile datatypes in the "extra-config" field. * gnu/tests/databases.scm (%postgresql-os): Test it. * doc/guix.texi (Database Services): Document it.
2020-12-01services: MySQL: Fix indentation.Marius Bakke
* gnu/services/databases.scm (mysql-upgrade-wrapper): Adjust indentation.
2020-12-01services: databases: Do not export record type descriptors.Marius Bakke
* gnu/services/databases.scm (<postgresql-config-file>, <postgresql-configuration>, <memcached-configuration>, <mongodb-configuration>): Remove exports.
2020-11-28services: MySQL: Upgrade database schemas automatically.Marius Bakke
* gnu/services/databases.scm (<mysql-configuration>): Add AUTO-UPGRADE? field. (mysql-upgrade-wrapper, mysql-upgrade-shepherd-service, mysql-shepherd-services): New variables. (mysql-service-type): Use MYSQL-SHEPHERD-SERVICES instead of MYSQL-SHEPHERD-SERVICE. * doc/guix.texi (Database Services): Document the AUTO-UPGRADE? field of MYSQL-SERVICE-TYPE. * gnu/tests/databases.scm (run-mysql-test): Test that mysql_upgrade has run.
2020-11-28services: MySQL: Make the socket configurable.Marius Bakke
* gnu/services/databases.scm (<mysql-configuration>): Add SOCKET field. (mysql-configuration-file): Adjust accordingly. * doc/guix.texi (Database Services): Likewise.
2020-11-28services: MySQL: Bind to localhost only by default.Marius Bakke
* gnu/services/databases.scm (<mysql-configuration>): Add BIND-ADDRESS field. (mysql-configuration-file): Adjust accordingly. * doc/guix.texi (Database Services): Document it.
2020-11-28services: MySQL: Deprecate 'mysql-service'.Marius Bakke
* gnu/services/databases.scm (mysql-service): Define in terms of DEFINE-DEPRECATED. * gnu/tests/databases.scm (%mysql-os): Adjust accordingly. * doc/guix.texi (Database Services): Adjust the MariaDB/MySQL section to document MYSQL-SERVICE-TYPE instead of MYSQL-SERVICE. While at it, document the EXTRA-CONTENT field.
2020-10-20services: databases: Don't specify a default postgresql version.Christopher Baines
Currently, if the postgresql package major version changes, this is going to break the service upon upgrade, because PostgreSQL will reject the data files from the differing major version of the service. Because it's important to either keep running a particular major version, or intentionally upgrade, I think the configuration would be better with no default. I think this is also going to be helpful when trying to assist users upgrading PostgreSQL. * gnu/services/databases.scm (<postgresql-configuration>): Remove default for postgresql. (postgresql-service-type): Remove the default value. * gnu/tests/databases.scm (%postgresql-os): Update accordingly. * gnu/tests/guix.scm (%guix-data-service-os): Update accordingly. * gnu/tests/monitoring.scm (%zabbix-os): Update accordingly. * gnu/tests/web.scm (patchwork-os): Update accordingly. * doc/guix.texi (PostgreSQL): Update accordingly.
2020-10-20services: databases: Deprecate the postgresql-service procedure.Christopher Baines
Using the service type directly is a better approach, making it easier to configure the service. * gnu/services/databases.scm (postgresql-service): Deprecate this procedure. * doc/guix.texi (PostgreSQL): Update the documentation for the use of (service postgresql-service-type).
2020-08-01services: postgresql: Provide postgresql commands.Pierre Neidhardt
* gnu/services/databases.scm (postgresql-service-type): Extend profile-service-type to provide postgresql commands.
2020-01-17gnu: services: Allow extra content in mysql configuration.Alex Sassmannshausen
* gnu/services/databases.scm (<mysql-configuration>): New field. (mysql-configuration-file): Use it.
2020-01-14gnu: services: Fix mysql service activation.Julien Lepiller
This change is necessary after the split of mariadb outputs. * gnu/services/databases.scm (%mysql-activation): Use mysql:lib in mariadb-specific part.
2019-07-02gnu: postgres service: More secure default permissions.Robert Vollmert
This changes to 'peer' authentication for local socket connections, and password-based authentication for local network connections. * gnu/services/databases.scm (%default-postgres-hba): Change authentication method. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-10-04gnu: postgresql: Add extension-packages.Julien Lepiller
* gnu/services/databases.scm (postgresql-configuration): Add extension-packages. (postgresql-shepherd-service): New key #:extension-packages. * doc/guix.texi (Database Services): Document it.
2018-08-13services: postgresql: Get the Shepherd to respawn PostgreSQL.Clément Lassieur
* gnu/services/databases.scm (postgresql-shepherd-service): Change 'start' to return the PID.
2018-03-17services: databases: Change quote' to single-quote.Christopher Baines
In the postgresql-config-file gexp compiler. * gnu/services/databases.scm (postgresql-config-file-compiler): Change quote' to single-quote.
2018-03-10services: databases: Add postgresql-configuration record exports.Christopher Baines
* gnu/services/databases.scm: Export the record type, and all the field accessors.