Added enableTCPIP option for postgresql (defaults to false) to allow tcpip connections

svn path=/nixos/trunk/; revision=15391
This commit is contained in:
Rob Vermaas 2009-04-29 12:25:25 +00:00
parent 0f99f50e34
commit e3ad6a6f59
2 changed files with 11 additions and 2 deletions

View File

@ -2286,6 +2286,12 @@ in
How to authorize users.
Note: ident needs absolute trust to all allowed client hosts.";
};
enableTCPIP = mkOption {
default = false;
description = "
Whether to run PostgreSQL with -i flag to enable TCP/IP connections.
";
};
};

View File

@ -13,7 +13,7 @@ let
in
{
rec {
name = "postgresql";
users = [
@ -28,6 +28,9 @@ in
extraPath = [postgresql];
flags =
if cfg.enableTCPIP then ["-i"] else [] ;
job = ''
description "PostgreSQL server"
@ -43,6 +46,6 @@ in
cp -f ${pkgs.writeText "pg_hba.conf" cfg.authentication} ${cfg.dataDir}/pg_hba.conf
end script
respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir}'
respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir} ${toString flags}'
'';
}