Skip to content

Commit 920e7e1

Browse files
naveenpaul1romayalon
authored andcommitted
NC | noobaa log is not performing logrotate
Signed-off-by: naveenpaul1 <[email protected]> (cherry picked from commit c26e52f)
1 parent 9834cd7 commit 920e7e1

File tree

12 files changed

+24
-25
lines changed

12 files changed

+24
-25
lines changed

docs/dev_guide/standalone_with_db.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ You can use the configuration for `rsyslog` and `logrotate` for RHEL8. The logs
181181

182182
```
183183
sudo cp src/deploy/standalone/noobaa_syslog.conf /etc/rsyslog.d/
184-
sudo cp src/deploy/standalone/logrotate_noobaa.conf /etc/logrotate.d/
184+
sudo cp src/deploy/standalone/noobaa-logrotate /etc/logrotate.d/
185185
sudo systemctl restart systemd-journald rsyslog
186186
```
187187

@@ -192,7 +192,7 @@ Additionally, it would be helpful if you configure to disable the rate limit of
192192
1. Add the 2 lines below into `/etc/systemd/journald.conf`
193193

194194
```
195-
RateLimitInterva]lSec=0s
195+
RateLimitIntervalSec=0s
196196
RateLimitBurst=0
197197
```
198198

docs/non_containerized_NSFS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,14 +582,14 @@ systemctl status rsyslog
582582

583583
Noobaa logs are pushed to `var/log/noobaa.log` and the log is rotated and compressed daily.
584584

585-
Verify the rsyslog and logrotate rpm configuration is complete by checking the files `etc/rsyslog.d/noobaa_syslog.conf` for rsyslog and `etc/logrotate.d/noobaa/logrotate_noobaa.conf` for logrotate.These files contain the noobaa specific configuration for rsyslog and logrotate.
585+
Verify the rsyslog and logrotate rpm configuration is complete by checking the files `etc/rsyslog.d/noobaa_syslog.conf` for rsyslog and `etc/logrotate.d/noobaa-logrotate` for logrotate.These files contain the noobaa specific configuration for rsyslog and logrotate.
586586

587-
Logrotate configuration is set up under `/etc/logrotate.d/noobaa/`. In order to trigger rotation when log files reache size threshold, each log file (`/var/log/noobaa.log` and `/var/log/noobaa_events.log`) uses its own rsyslog `outchannel` that triggers logrotate once file size reaches a limit (105MB). Logrotate is also typically called from cron on daily schedule.
587+
Logrotate configuration is set up under `/etc/logrotate.d/`. Logrotate is called from cron on daily schedule.
588588

589589
To rotate the logs manually run.
590590

591591
```
592-
logrotate /etc/logrotate.d/noobaa/logrotate_noobaa.conf
592+
logrotate /etc/logrotate.d/noobaa-logrotate
593593
```
594594

595595
**Create env file under the configuration directory (OPTIONAL) -**

src/deploy/NVA_build/NooBaa.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ COPY ./src/deploy/NVA_build/supervisord.orig /tmp/supervisord
110110
COPY ./src/deploy/NVA_build/supervisorctl.bash_completion /etc/bash_completion.d/supervisorctl
111111
COPY ./src/deploy/NVA_build/rsyslog.conf /etc/rsyslog.conf
112112
COPY ./src/deploy/NVA_build/noobaa_syslog.conf /etc/rsyslog.d/
113-
COPY ./src/deploy/NVA_build/logrotate_noobaa.conf /etc/logrotate.d/noobaa/
113+
COPY ./src/deploy/NVA_build/noobaa-logrotate /etc/logrotate.d/
114114
COPY ./src/deploy/NVA_build/noobaa_init.sh /noobaa_init_files/
115115

116116
COPY ./src/deploy/NVA_build/setup_platform.sh /usr/bin/setup_platform.sh

src/deploy/NVA_build/logrotate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo "*/5 * * * * /root/node_modules/noobaa-core/src/deploy/NVA_build/noobaa_log
88
while true; do
99

1010
echo "$(date): =================================== running logrotate ===================================" >/dev/stdout 2>&1
11-
/usr/sbin/logrotate -v /etc/logrotate.d/noobaa/logrotate_noobaa.conf >/dev/stdout 2>&1
11+
/usr/sbin/logrotate -v /etc/logrotate.d/noobaa-logrotate >/dev/stdout 2>&1
1212
echo "$(date): =================================== logrotate Done ======================================" >/dev/stdout 2>&1
1313

1414
sleep 60
File renamed without changes.

src/deploy/RPM_build/RPM.Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ARG CENTOS_VER=9
55
ARG BUILD_S3SELECT=0
66
ARG BUILD_S3SELECT_PARQUET=0
77

8-
RUN mkdir -p /etc/logrotate.d/noobaa/
98
RUN mkdir -p /etc/noobaa.conf.d/
109

1110
COPY ./src/agent ./src/agent
@@ -35,8 +34,7 @@ COPY ./package*.json ./
3534
COPY ./binding.gyp .
3635
COPY ./src/deploy/standalone/noobaa_rsyslog.conf ./src/deploy/standalone/noobaa_rsyslog.conf
3736
COPY ./src/deploy/standalone/noobaa_syslog.conf ./src/deploy/standalone/noobaa_syslog.conf
38-
COPY ./src/deploy/standalone/logrotate_noobaa.conf ./src/deploy/standalone/logrotate_noobaa.conf
39-
COPY ./src/deploy/standalone/logrotate_noobaa.sh ./src/deploy/standalone/logrotate_noobaa.sh
37+
COPY ./src/deploy/standalone/noobaa-logrotate ./src/deploy/standalone/noobaa-logrotate
4038
COPY ./src/manage_nsfs ./src/manage_nsfs
4139

4240
WORKDIR /build

src/deploy/RPM_build/noobaa.spec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,14 @@ mkdir -p $RPM_BUILD_ROOT/etc/noobaa.conf.d/
8787
mkdir -p $RPM_BUILD_ROOT/etc/rsyslog.d/
8888
mv $RPM_BUILD_ROOT/usr/local/noobaa-core/src/deploy/standalone/noobaa_syslog.conf $RPM_BUILD_ROOT/etc/rsyslog.d/noobaa_syslog.conf
8989

90-
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/noobaa
91-
ln -s /usr/local/noobaa-core/src/deploy/standalone/logrotate_noobaa.conf $RPM_BUILD_ROOT/etc/logrotate.d/noobaa/logrotate_noobaa.conf
92-
chmod +x $RPM_BUILD_ROOT/usr/local/noobaa-core/src/deploy/standalone/logrotate_noobaa.sh
90+
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
91+
mv $RPM_BUILD_ROOT/usr/local/noobaa-core/src/deploy/standalone/noobaa-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/noobaa-logrotate
9392

9493
%files
9594
/usr/local/noobaa-core
9695
%{_unitdir}/noobaa.service
97-
/etc/logrotate.d/noobaa/logrotate_noobaa.conf
98-
/etc/rsyslog.d/noobaa_syslog.conf
96+
%config(noreplace) /etc/logrotate.d/noobaa-logrotate
97+
%config(noreplace) /etc/rsyslog.d/noobaa_syslog.conf
9998
/etc/noobaa.conf.d/
10099
/usr/local/bin/noobaa-cli
101100
%doc

src/deploy/spectrum_archive/deployment_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ systemctl status rsyslog
157157

158158
Noobaa logs are pushed to `/var/log/noobaa.log` and the log is rotated and compressed daily.
159159

160-
Verify the rsyslog and logrotate rpm configuration is complete by checking the files `/etc/rsyslog.d/noobaa_syslog.conf` and `/etc/rsyslog.d/noobaa_rsyslog.conf` for rsyslog and `/etc/logrotate.d/noobaa/logrotate_noobaa.conf` for logrotate.These files contain the noobaa specific configuration for rsyslog and logrotate.
160+
Verify the rsyslog and logrotate rpm configuration is complete by checking the files `/etc/rsyslog.d/noobaa_syslog.conf` and `/etc/rsyslog.d/noobaa_rsyslog.conf` for rsyslog and `/etc/logrotate.d/noobaa-logrotate` for logrotate.These files contain the noobaa specific configuration for rsyslog and logrotate.
161161

162162
Rotate the logs manually.
163163

164164
```
165-
logrotate /etc/logrotate.d/noobaa/logrotate_noobaa.conf
165+
logrotate /etc/logrotate.d/noobaa-logrotate
166166
```
167167

168168
# FAQ

src/deploy/standalone/logrotate_noobaa.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/deploy/standalone/logrotate_noobaa.conf renamed to src/deploy/standalone/noobaa-logrotate

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
postrotate
1313
killall -HUP rsyslogd || true
1414
killall -HUP syslogd || true
15+
systemctl reload syslog-ng > /dev/null 2>&1 || true
1516
endscript
1617
}
1718

@@ -29,6 +30,7 @@
2930
postrotate
3031
killall -HUP rsyslogd || true
3132
killall -HUP syslogd || true
33+
systemctl reload syslog-ng > /dev/null 2>&1 || true
3234
endscript
3335
}
3436

@@ -44,5 +46,6 @@
4446
postrotate
4547
killall -HUP rsyslogd || true
4648
killall -HUP syslogd || true
49+
systemctl reload syslog-ng > /dev/null 2>&1 || true
4750
endscript
4851
}

0 commit comments

Comments
 (0)