Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Context Sensitive Group
freedombone
Commits
54f4a246
Commit
54f4a246
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Move postgresql logging functions
parent
f2654245
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-logging
+0
-19
0 additions, 19 deletions
src/freedombone-logging
src/freedombone-utils-postgresql
+20
-0
20 additions, 0 deletions
src/freedombone-utils-postgresql
with
20 additions
and
19 deletions
src/freedombone-logging
+
0
−
19
View file @
54f4a246
...
...
@@ -90,25 +90,6 @@ function turn_logging_off {
done
}
function
turn_off_postgresql_logging
{
if
[
!
-f
/etc/postgresql/9.6/main/postgresql.conf
]
;
then
return
fi
sed
-i
's|#log_destination|log_destination|g'
/etc/postgresql/9.6/main/postgresql.conf
sed
-i
"s|log_destination.*|log_destination = 'syslog'|g"
/etc/postgresql/9.6/main/postgresql.conf
if
[
-d
/var/log/postgresql
]
;
then
$REMOVE_FILES_COMMAND
/var/log/postgresql/
*
fi
}
function
turn_on_postgresql_logging
{
if
[
!
-f
/etc/postgresql/9.6/main/postgresql.conf
]
;
then
return
fi
sed
-i
's|log_destination|#log_destination|g'
/etc/postgresql/9.6/main/postgresql.conf
sed
-i
"s|log_destination.*|log_destination = 'stderr'|g"
/etc/postgresql/9.6/main/postgresql.conf
}
function
turn_off_rsys_logging
{
if
!
grep
-q
'/var/log/auth.log'
/etc/rsyslog.conf
;
then
return
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-postgresql
+
20
−
0
View file @
54f4a246
...
...
@@ -29,6 +29,26 @@
# Set this when calling backup and restore commands
USE_POSTGRESQL
=
POSTGRESQL_PACKAGES
=
'postgresql-9.6 postgresql-contrib-9.6 postgresql-client'
POSTGRESQL_VERSION
=
9.6
function
turn_off_postgresql_logging
{
if
[
!
-f
/etc/postgresql/
$POSTGRESQL_VERSION
/main/postgresql.conf
]
;
then
return
fi
sed
-i
's|#log_destination|log_destination|g'
/etc/postgresql/
$POSTGRESQL_VERSION
/main/postgresql.conf
sed
-i
"s|log_destination.*|log_destination = 'syslog'|g"
/etc/postgresql/
$POSTGRESQL_VERSION
/main/postgresql.conf
if
[
-d
/var/log/postgresql
]
;
then
$REMOVE_FILES_COMMAND
/var/log/postgresql/
*
fi
}
function
turn_on_postgresql_logging
{
if
[
!
-f
/etc/postgresql/
$POSTGRESQL_VERSION
/main/postgresql.conf
]
;
then
return
fi
sed
-i
's|log_destination|#log_destination|g'
/etc/postgresql/
$POSTGRESQL_VERSION
/main/postgresql.conf
sed
-i
"s|log_destination.*|log_destination = 'stderr'|g"
/etc/postgresql/
$POSTGRESQL_VERSION
/main/postgresql.conf
}
function
store_original_postgresql_password
{
if
[
!
-f
/root/.postgresqloriginal
]
;
then
...
...
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