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
10b83f16
Commit
10b83f16
authored
2 years ago
by
Christoph Berg
📡
Browse files
Options
Downloads
Patches
Plain Diff
PgCommon.pm: Dump netstat info when ports are in use and debug is on
parent
e9e4a719
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PgCommon.pm
+5
-1
5 additions, 1 deletion
PgCommon.pm
with
5 additions
and
1 deletion
PgCommon.pm
+
5
−
1
View file @
10b83f16
...
...
@@ -5,7 +5,7 @@ PgCommon - Common functions for the postgresql-common framework
=head1 COPYRIGHT AND LICENSE
(C) 2008-2009 Martin Pitt <mpitt@debian.org>
(C) 2012-202
1
Christoph Berg <myon@debian.org>
(C) 2012-202
2
Christoph Berg <myon@debian.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
...
...
@@ -1100,6 +1100,7 @@ sub next_free_port {
# port in use by existing cluster
if
(
exists
$ports
{
$port
})
{
print
"
next_free_port: port
$port
in use on by existing cluster
\n
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
system
"
ss --no-header -ap 'sport >= 5432 and sport <= 5439'
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
next
;
}
...
...
@@ -1112,6 +1113,8 @@ sub next_free_port {
close
SOCK
;
unless
(
$res4
)
{
print
"
next_free_port: port
$port
in use on IPv4:
$err
\n
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
print
"
next_free_port: port
$port
in use on IPv4
\n
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
system
"
ss --no-header -ap 'sport >= 5432 and sport <= 5439'
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
next
;
}
}
...
...
@@ -1125,6 +1128,7 @@ sub next_free_port {
close
SOCK
;
unless
(
$res6
)
{
print
"
next_free_port: port
$port
in use on IPv6:
$err
\n
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
system
"
ss --no-header -ap 'sport >= 5432 and sport <= 5439'
"
if
exists
$ENV
{
DEBUG_NEXT_FREE_PORT
};
next
;
}
}
...
...
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