rabbitmq logrotate doesn't work properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mirantis OpenStack |
Fix Released
|
Medium
|
Ivan Suzdal | ||
7.0.x |
Won't Fix
|
Medium
|
Denis Meltsaykin | ||
8.0.x |
Fix Released
|
Medium
|
Ivan Suzdal | ||
9.x |
Invalid
|
Medium
|
Alexey Lebedeff |
Bug Description
the logrotate config for rabbitmq removes old logs instead of create a new one. /etc/logrotate.
[root@node-8 ~]# ls -la /var/log/
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 10:42 /<email address hidden>
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 10:42 /<email address hidden>
[root@node-8 ~]# service rabbitmq-server rotate-logs > /dev/null
[root@node-8 ~]# ls -la /var/log/
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 11:05 /<email address hidden>
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 11:05 /<email address hidden>
We need to use the following command:
DATE=-`date +%y_%m_
[root@node-13 ~]# ls -la /var/log/
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 10:47 /<email address hidden>
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 10:47 /<email address hidden>
[root@node-13 ~]# DATE=-`date +%y_%m_
Rotating logs to files with suffix "-15_07_
...done.
[root@node-13 ~]# ls -la /var/log/
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 11:06 /<email address hidden>
-rw-r----- 1 rabbitmq rabbitmq 91 Jul 10 11:06 /<email address hidden>
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 11:06 /<email address hidden>
-rw-r----- 1 rabbitmq rabbitmq 0 Jul 10 11:06 /<email address hidden>
api: '1.0'
astute_sha: 1ea8017fe888941
auth_required: true
build_id: 2015-06-19_13-02-31
build_number: '525'
feature_groups:
- mirantis
fuel-library_sha: 2e7a08ad9792c70
fuel-ostf_sha: 8fefcf7c4649370
fuelmain_sha: a3998372183468f
nailgun_sha: dbd54158812033d
openstack_version: 2014.2.2-6.1
production: docker
python-
release: '6.1'
Changed in fuel: | |
milestone: | none → 7.0 |
assignee: | nobody → Fuel Library Team (fuel-library) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in fuel: | |
assignee: | Fuel Library Team (fuel-library) → Bartlomiej Piotrowski (bpiotrowski) |
Changed in fuel: | |
assignee: | Bartlomiej Piotrowski (bpiotrowski) → Florek (sflorczak) |
Changed in fuel: | |
assignee: | Florek (sflorczak) → MOS Packaging Team (mos-packaging) |
Changed in fuel: | |
assignee: | MOS Packaging Team (mos-packaging) → Igor Yozhikov (iyozhikov) |
assignee: | Igor Yozhikov (iyozhikov) → Aleksander Mogylchenko (amogylchenko) |
Changed in fuel: | |
milestone: | 7.0 → 8.0 |
tags: | added: area-linux |
Changed in fuel: | |
assignee: | Aleksander Mogylchenko (amogylchenko) → Ivan Suzdal (isuzdal) |
no longer affects: | fuel/7.0.x |
no longer affects: | fuel |
Because ROTATE_SUFFIX in the configuration file is not set the log is cleared. d/rabbitmq- server
However "service rabbitmq-server rotate-logs" shouldn't be used in the first place. The proper way to rotate the logs is using: logrotate -f /etc/logrotate.