399
408
# Return a hash with information about a specific cluster.
400
409
# Arguments: <version> <cluster name>
401
# Returns: information hash (keys: pgdata, port, running, logfile, configdir,
410
# Returns: information hash (keys: pgdata, port, running, logfile [unless it
411
# has a custom one], configdir, owneruid, ownergid, socketdir)
404
413
error 'cluster_info must be called with <version> <cluster> arguments' unless $_[0] && $_[1];
407
416
$result{'configdir'} = "$confroot/$_[0]/$_[1]";
409
417
my %postgresql_conf = read_cluster_conf_file $_[0], $_[1], 'postgresql.conf';
410
419
$result{'port'} = $postgresql_conf{'port'} || $defaultport;
411
420
$result{'socketdir'} = get_cluster_socketdir $_[0], $_[1];
412
421
$result{'running'} = cluster_port_running ($_[0], $_[1], $result{'port'});