Merge pull request #57677 from aszlig/postgresql-socket-in-run
postgresql: Move socket dir to /run/postgresql
This commit is contained in:
commit
5a9eaf02ae
@ -62,6 +62,16 @@
|
|||||||
compatible with Python 3.
|
compatible with Python 3.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
PostgreSQL now uses
|
||||||
|
<filename class="directory">/run/postgresql</filename> as its socket
|
||||||
|
directory instead of <filename class="directory">/tmp</filename>. So
|
||||||
|
if you run an application like eg. Nextcloud, where you need to use
|
||||||
|
the Unix socket path as the database host name, you need to change it
|
||||||
|
accordingly.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -238,6 +238,7 @@ in
|
|||||||
User = "postgres";
|
User = "postgres";
|
||||||
Group = "postgres";
|
Group = "postgres";
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
|
RuntimeDirectory = "postgresql";
|
||||||
Type = if lib.versionAtLeast cfg.package.version "9.6"
|
Type = if lib.versionAtLeast cfg.package.version "9.6"
|
||||||
then "notify"
|
then "notify"
|
||||||
else "simple";
|
else "simple";
|
||||||
|
@ -172,7 +172,7 @@ in {
|
|||||||
Database host.
|
Database host.
|
||||||
|
|
||||||
Note: for using Unix authentication with PostgreSQL, this should be
|
Note: for using Unix authentication with PostgreSQL, this should be
|
||||||
set to <literal>/tmp</literal>.
|
set to <literal>/run/postgresql</literal>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
dbport = mkOption {
|
dbport = mkOption {
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
config = {
|
config = {
|
||||||
<link linkend="opt-services.nextcloud.config.dbtype">dbtype</link> = "pgsql";
|
<link linkend="opt-services.nextcloud.config.dbtype">dbtype</link> = "pgsql";
|
||||||
<link linkend="opt-services.nextcloud.config.dbuser">dbuser</link> = "nextcloud";
|
<link linkend="opt-services.nextcloud.config.dbuser">dbuser</link> = "nextcloud";
|
||||||
<link linkend="opt-services.nextcloud.config.dbhost">dbhost</link> = "/tmp"; # nextcloud will add /.s.PGSQL.5432 by itself
|
<link linkend="opt-services.nextcloud.config.dbhost">dbhost</link> = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
|
||||||
<link linkend="opt-services.nextcloud.config.dbname">dbname</link> = "nextcloud";
|
<link linkend="opt-services.nextcloud.config.dbname">dbname</link> = "nextcloud";
|
||||||
<link linkend="opt-services.nextcloud.config.adminpassFile">adminpassFile</link> = "/path/to/admin-pass-file";
|
<link linkend="opt-services.nextcloud.config.adminpassFile">adminpassFile</link> = "/path/to/admin-pass-file";
|
||||||
<link linkend="opt-services.nextcloud.config.adminuser">adminuser</link> = "root";
|
<link linkend="opt-services.nextcloud.config.adminuser">adminuser</link> = "root";
|
||||||
|
@ -60,7 +60,7 @@ let
|
|||||||
(if atLeast "9.6" then ./patches/less-is-more-96.patch else ./patches/less-is-more.patch)
|
(if atLeast "9.6" then ./patches/less-is-more-96.patch else ./patches/less-is-more.patch)
|
||||||
(if atLeast "9.6" then ./patches/hardcode-pgxs-path-96.patch else ./patches/hardcode-pgxs-path.patch)
|
(if atLeast "9.6" then ./patches/hardcode-pgxs-path-96.patch else ./patches/hardcode-pgxs-path.patch)
|
||||||
./patches/specify_pkglibdir_at_runtime.patch
|
./patches/specify_pkglibdir_at_runtime.patch
|
||||||
];
|
] ++ lib.optional stdenv.isLinux ./patches/socketdir-in-run.patch;
|
||||||
|
|
||||||
installTargets = [ "install-world" ];
|
installTargets = [ "install-world" ];
|
||||||
|
|
||||||
|
13
pkgs/servers/sql/postgresql/patches/socketdir-in-run.patch
Normal file
13
pkgs/servers/sql/postgresql/patches/socketdir-in-run.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
|
||||||
|
index 743401cb96..be5c5f61d2 100644
|
||||||
|
--- a/src/include/pg_config_manual.h
|
||||||
|
+++ b/src/include/pg_config_manual.h
|
||||||
|
@@ -179,7 +179,7 @@
|
||||||
|
* here's where to twiddle it. You can also override this at runtime
|
||||||
|
* with the postmaster's -k switch.
|
||||||
|
*/
|
||||||
|
-#define DEFAULT_PGSOCKET_DIR "/tmp"
|
||||||
|
+#define DEFAULT_PGSOCKET_DIR "/run/postgresql"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the default event source for Windows event log.
|
Loading…
x
Reference in New Issue
Block a user