Skip to content

Commit c35c5f8

Browse files
committed
Change minimum log file size to 1k and remove create option (implied by sharedscripts). Use pkill command for postrotate script.
1 parent 9f19412 commit c35c5f8

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

internal/collector/logrotate.conf

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
%s {
2-
32
rotate %s
4-
53
missingok
6-
74
sharedscripts
8-
95
notifempty
10-
116
nocompress
12-
13-
size 10m
14-
7+
size 1k
158
%s
16-
17-
create 0640 postgres postgres
18-
199
postrotate
20-
2110
%s
22-
2311
endscript
24-
2512
}

internal/collector/pgbouncer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ func AddPgBouncerLogrotateConfig(ctx context.Context, outInstanceConfigMap *core
193193

194194
// FIXME: get retentionPeriod from instrumentationSpec
195195
pgbouncerLogPath := naming.PGBouncerLogPath + "/pgbouncer.log"
196-
retentionPeriod := "1d"
197-
postrotateScript := "/bin/kill -HUP `cat /var/pgbouncer-postgres/pgbouncer.pid 2> /dev/null` 2>/dev/null ||true"
196+
retentionPeriod := "1h"
197+
postrotateScript := "pkill -HUP --exact pgbouncer"
198198

199199
logrotateConfig, err := generateLogrotateConfig(pgbouncerLogPath, retentionPeriod, postrotateScript)
200200
if err != nil {

0 commit comments

Comments
 (0)