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
e83bbefd
Commit
e83bbefd
authored
10 years ago
by
Christoph Berg
Browse files
Options
Downloads
Patches
Plain Diff
Put stats_temp_directory aka pg_stat_tmp into /var/run/postgresql by
default. (Closes: #739276)
parent
05b7a6d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
createcluster.conf
+7
-4
7 additions, 4 deletions
createcluster.conf
debian/changelog
+7
-0
7 additions, 0 deletions
debian/changelog
pg_createcluster
+49
-7
49 additions, 7 deletions
pg_createcluster
with
63 additions
and
11 deletions
createcluster.conf
+
7
−
4
View file @
e83bbefd
# Default values for pg_createcluster(8)
# Occurrences of '%v' are replaced by the major version number,
# and '%c' by the cluster name. Use '%%' for a literal '%'.
# Create a "main" cluster when a new postgresql-x.y server package is installed
#create_main_cluster = true
...
...
@@ -7,9 +9,6 @@
# See pg_createcluster(8) for more documentation.
#start_conf = 'auto'
# In the following options, occurrences of '%v' are replaced by the major
# version number, and '%c' by the cluster name. Use '%%' for a literal '%'.
# Default data directory.
#data_directory = '/var/lib/postgresql/%v/%c'
...
...
@@ -20,10 +19,14 @@
# Options to pass to initdb.
#initdb_options = ''
# The following options are copied into the new cluster's postgresql.conf:
# Enable SSL by default (using the "snakeoil" certificates installed by the
# ssl-cert package, unless configured otherwise here)
ssl
=
__
SSL__
# All other options are copied into the new cluster's postgresql.conf
# Put stats_temp_directory on tmpfs
stats_temp_directory
=
'/var/run/postgresql/%v-%c.pg_stat_tmp'
# Add timestamps to log lines
log_line_prefix
=
'%%t '
This diff is collapsed.
Click to expand it.
debian/changelog
+
7
−
0
View file @
e83bbefd
postgresql-common (158) UNRELEASED; urgency=medium
* Put stats_temp_directory aka pg_stat_tmp into /var/run/postgresql by
default. (Closes: #739276)
-- Christoph Berg <myon@debian.org> Tue, 03 Jun 2014 21:30:05 +0200
postgresql-common (157) unstable; urgency=medium
* Remove createcluster.conf on purge.
...
...
This diff is collapsed.
Click to expand it.
pg_createcluster
+
49
−
7
View file @
e83bbefd
...
...
@@ -458,6 +458,33 @@ my $ssl_key_access;
my
(
$uid
,
$euid
,
$gid
,
$egid
)
=
(
$<
,
$>
,
$(
,
$
));
change_ugid
$owneruid
,
$ownergid
;
$ssl_key_access
=
-
r
$ssl_key_file
;
# check for stats_temp_directory access
if
(
$defaultconf
{
stats_temp_directory
})
{
my
$stats_temp_directory
=
replace_v_c
(
$defaultconf
{
stats_temp_directory
},
$version
,
$cluster
);
$stats_temp_directory
=~
s!/$!!
;
# strip trailing slash
my
$stats_temp_parent
=
$stats_temp_directory
;
$stats_temp_parent
=~
s!/[^/]+$!!
;
if
(
-
d
$stats_temp_directory
)
{
if
(
!
-
w
$stats_temp_directory
)
{
print
"
Warning: The selected stats_temp_directory
$stats_temp_directory
is not writable for the cluster owner. Not adding this setting in
postgresql.conf.
\n
";
delete
$defaultconf
{
stats_temp_directory
};
}
}
elsif
(
!
-
d
$stats_temp_parent
)
{
print
"
Warning: The parent
$stats_temp_parent
of the selected
stats_temp_directory does not exist. Not adding this setting in
postgresql.conf.
\n
";
delete
$defaultconf
{
stats_temp_directory
};
}
elsif
(
!
-
w
$stats_temp_parent
)
{
print
"
Warning: The parent
$stats_temp_parent
of the selected
stats_temp_directory is not writable for the cluster owner. Not adding this
setting in postgresql.conf.
\n
";
delete
$defaultconf
{
stats_temp_directory
};
}
}
$>
=
$euid
;
$<
=
$uid
;
$(
=
$gid
;
...
...
@@ -538,8 +565,8 @@ if ($socketdir eq '/var/run/postgresql') {
# handle other createcluster.conf parameters
foreach
my
$guc
(
sort
keys
%defaultconf
)
{
next
if
$guc
=~
/^(create_main_cluster|start_conf|data_directory|xlogdir|initdb_options|ssl)$/
;
PgCommon::
set_conf_value
$version
,
$cluster
,
'
postgresql.conf
',
$guc
,
replace_v_c
(
$defaultconf
{
$guc
},
$version
,
$cluster
)
;
my
$val
=
replace_v_c
(
$defaultconf
{
$guc
},
$version
,
$cluster
);
PgCommon::
set_conf_value
$version
,
$cluster
,
'
postgresql.conf
',
$guc
,
$val
;
}
# process --pgoption parameters
...
...
@@ -776,7 +803,9 @@ additional options passed to pg_ctl of that cluster.
=head1 DEFAULT VALUES
Some default values used by B<pg_createcluster> can be modified in
C</etc/postgresql-common/createcluster.conf>:
C</etc/postgresql-common/createcluster.conf>. Occurrences of B<%v> are replaced
by the major version number, and B<%c> by the cluster name. Use B<%%> for a
literal B<%>.
=over 4
...
...
@@ -790,9 +819,6 @@ Default C<start.conf> value to use.
=back
In the following options, occurrences of B<%v> are replaced by the major
version number, and B<%c> by the cluster name. Use B<%%> for a literal B<%>.
=over 4
=item B<data_directory> (Default: B</var/lib/postgresql/%v/%c>)
...
...
@@ -809,13 +835,29 @@ default, i.e. pg_xlog is remains in the data directory.
Other options to pass to B<initdb>.
=item
I<o
ther options
> (Default: none)
=item
O
ther options
All other options listed are copied into the new cluster's postgresql.conf, e.g.:
listen_addresses = '*'
log_line_prefix = '%%t '
Some postgresql.conf options are treated specially:
=over 4
=item B<ssl>
Only added to postgresql.conf if the default snakeoil certificates exist and
are readable for the cluster owner as detailed above.
=item B<stats_temp_directory>
Only added to postgresql.conf if existing, and writable for the cluster owner,
or else if the parent directory is writable.
=back
=back
=head1 SEE ALSO
...
...
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