Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
postgresql-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PostgreSQL
postgresql-common
Commits
644fc98b
Commit
644fc98b
authored
20 years ago
by
Martin Pitt
Browse files
Options
Downloads
Patches
Plain Diff
add unix_socket_directory support to PgCommon
parent
f4e93ebe
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
postgresql-common-9/PgCommon.pm
+16
-1
16 additions, 1 deletion
postgresql-common-9/PgCommon.pm
postgresql-common-9/debian/changelog
+2
-1
2 additions, 1 deletion
postgresql-common-9/debian/changelog
postgresql-common-9/debian/init.d-functions
+4
-0
4 additions, 0 deletions
postgresql-common-9/debian/init.d-functions
with
22 additions
and
2 deletions
postgresql-common-9/PgCommon.pm
+
16
−
1
View file @
644fc98b
...
...
@@ -7,6 +7,7 @@ use Exporter;
$VERSION
=
1.00
;
@ISA
=
('
Exporter
');
@EXPORT
=
qw/error user_cluster_map get_cluster_port set_cluster_port
get_cluster_socketdir set_cluster_socketdir
get_program_path cluster_info get_versions get_newest_version
get_version_clusters next_free_port cluster_exists install_file/
;
@EXPORT_OK
=
qw/$confroot/
;
...
...
@@ -89,6 +90,19 @@ sub set_cluster_port {
set_conf_value
$_
[
0
],
$_
[
1
],
'
postgresql.conf
',
'
port
',
$_
[
2
];
}
# Return the socket directory of a particular cluster or undef if the cluster
# does not exist.
# Arguments: <version> <cluster>
sub
get_cluster_socketdir
{
return
get_conf_value
(
$_
[
0
],
$_
[
1
],
'
postgresql.conf
',
'
unix_socket_directory
');
}
# Set the socket directory of a particular cluster.
# Arguments: <version> <cluster> <directory>
sub
set_cluster_socketdir
{
set_conf_value
$_
[
0
],
$_
[
1
],
'
postgresql.conf
',
'
unix_socket_directory
',
$_
[
2
];
}
# Return the path of a program of a particular version.
# Arguments: <program name> <version>
sub
get_program_path
{
...
...
@@ -111,12 +125,13 @@ sub port_running {
# Return a hash with information about a specific cluster.
# Arguments: <version> <cluster name>
# Returns: information hash (keys: pgdata, port, running, logfile, configdir,
# owneruid, ownergid)
# owneruid, ownergid
, socketdir
)
sub
cluster_info
{
$result
{'
configdir
'}
=
"
$confroot
/
$_
[0]/
$_
[1]
";
$result
{'
pgdata
'}
=
readlink
(
$result
{'
configdir
'}
.
"
/pgdata
");
$result
{'
logfile
'}
=
readlink
(
$result
{'
configdir
'}
.
"
/log
");
$result
{'
port
'}
=
(
get_conf_value
$_
[
0
],
$_
[
1
],
'
postgresql.conf
',
'
port
')
||
$defaultport
;
$result
{'
socketdir
'}
=
(
get_conf_value
$_
[
0
],
$_
[
1
],
'
postgresql.conf
',
'
unix_socket_directory
')
||
'
/tmp
';
$result
{'
running
'}
=
port_running
(
$_
[
0
],
$result
{'
port
'});
if
(
$result
{'
pgdata
'})
{
(
$result
{'
owneruid
'},
$result
{'
ownergid
'})
=
...
...
This diff is collapsed.
Click to expand it.
postgresql-common-9/debian/changelog
+
2
−
1
View file @
644fc98b
...
...
@@ -10,8 +10,9 @@ postgresql-common (9) experimental; urgency=low
- Configure the target cluster to use the original port, move the old
cluster to a previously unused port.
- Start the new cluster after upgrade.
* debian/init.d-functions: Create /var/run/postgresql if it does not exist.
-- Martin Pitt <mpitt@debian.org> Sun, 22 May 2005
15:03:54
+0200
-- Martin Pitt <mpitt@debian.org> Sun, 22 May 2005
20:49:27
+0200
postgresql-common (8) experimental; urgency=low
...
...
This diff is collapsed.
Click to expand it.
postgresql-common-9/debian/init.d-functions
+
4
−
0
View file @
644fc98b
...
...
@@ -31,6 +31,10 @@ do_ctl_all() {
# start all clusters of version $1
# output according to Debian Policy for init scripts
start() {
# create socket directory
[ -d /var/run/postgresql ] || \
install -d -m 775 -o postgres -g postgres /var/run/postgresql
do_ctl_all start "$1" "Starting PostgreSQL $1 database server:"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment