1

Topic: Logwatch via cron terminates with error code 2

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5.-1
- Linux/BSD distribution name and version: Ubuntu 14.04.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? NO
- Related log if you're reporting an issue:
====
Hi!
On my server logwatch via cron terminates with error code 2.
In the mail comes the message:

run-parts: /etc/cron.daily/00logwatch exited with return code 2

If I run logwatch manually

# /usr/sbin/logwatch

I get this message:

gzip: stdout: No space left on device
system 'zcat '/var/log/syslog.2.gz' >> /tmp/logwatch.6X8S3UGd/syslog-archive' failed: 256 at /usr/sbin/logwatch line 774.

During the execution of logwatch place on / truly ends:

# df -h
udev                  991M         4,0K  991M            1% /dev
tmpfs                 202M         656K  201M            1% /run
/dev/dm-2             4,5G         4,5G     0          100% /
none                  4,0K            0  4,0K            0% /sys/fs/cgroup
none                  5,0M            0  5,0M            0% /run/lock
none                 1006M            0 1006M            0% /run/shm
none                  100M            0  100M            0% /run/user
/dev/sda1             474M         127M  323M           29% /boot
/dev/mapper/vg0-var    32G         8,4G   22G           28% /var
/dev/mapper/vg0-srv   459G         121G  315G           28% /srv

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Logwatch via cron terminates with error code 2

imak wrote:

gzip: stdout: No space left on device
...
# df -h
...
/dev/dm-2             4,5G         4,5G     0          100% /

It's clear here.

3

Re: Logwatch via cron terminates with error code 2

before running the script

# df -h
.........
/dev/dm-2             4,5G         1,7G  2,6G           40% /
..........

during the script

.........
# df -h
.........
/dev/dm-2             4,5G         1,7G  2,6G           54% /
..........
...........
# df -h
.........
/dev/dm-2             4,5G         4,4G     0          100% /
.........

after the script completes with an error

gzip: stdout: No space left on device
system 'zcat '/var/log/syslog.3.gz' >> /tmp/logwatch.6cAW6L9O/syslog-archive' failed: 256 at /usr/sbin/logwatch line 774.

# df -h
.........
/dev/dm-2             4,5G         1,7G  2,6G           40% /
..........

the script eats all the free space

4

Re: Logwatch via cron terminates with error code 2

imak wrote:

system 'zcat '/var/log/syslog.2.gz' >> /tmp/logwatch.6X8S3UGd/syslog-archive' failed: 256 at /usr/sbin/logwatch line 774.

Seems the original log file of /var/log/syslog.2.gz is too big, maybe you should move them.

Also, i'm confused why logwatch was trying to parse rotated log file.