[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: systemd, cgroups, lxc, rsyslog



On 27/12/19 2:30 am, Greg Wooledge wrote:
> On Fri, Dec 27, 2019 at 12:58:18AM +1300, Richard Hector wrote:
>> $ sudo systemctl kill -s HUP rsyslog.service
>> Failed to kill unit rsyslog.service: Input/output error
> 
>        -s, --signal=
>            When used with kill, choose which signal to send to selected
>            processes. Must be one of the well-known signal specifiers such as
>            SIGTERM, SIGINT or SIGSTOP. If omitted, defaults to SIGTERM.
> 
> So... first thought, what happens if you spell it SIGHUP instead of HUP?

No difference. Note that /usr/lib/rsyslog/rsyslog-rotate has HUP, and
HUP works on the test container.

> Second thought,
> <https://www.google.com/search?q=systemctl+kill+input%2Foutput+error>
> 
> Result #1 is
> <https://discourse.roots.io/t/failed-to-kill-unit-rsyslog-service-input-output-error/15495>
> which was closed after several weeks with no solution found.

I never saw that message about permissions; /var/log is 755 on both
containers, and /var/log/syslog is 640 on both.

However, I clearly hadn't been paying proper attention to the logs
earlier; while I get the messaged describe, rsyslogd logs that it _was_
HUPped. So it's not as bad as I thought. I haven't yet worked out
whether this is causing logrotate to fail.

Actually, it appears it does:

Dec 27 00:00:00 xxx-wp2 logrotate[9664]: Failed to kill unit
rsyslog.service: Input/output error
Dec 27 00:00:00 xxx-wp2 rsyslogd:  [origin software="rsyslogd"
swVersion="8.1901.0" x-pid="26099" x-info="https://www.rsyslog.com";]
rsyslogd was HUPed
Dec 27 00:00:00 xxx-wp2 logrotate[9664]: error: error running non-shared
postrotate script for /var/log/syslog of '/var/log/syslog
Dec 27 00:00:00 xxx-wp2 logrotate[9664]: '
Dec 27 00:00:00 xxx-wp2 systemd[1]: logrotate.service: Main process
exited, code=exited, status=1/FAILURE
Dec 27 00:00:00 xxx-wp2 systemd[1]: logrotate.service: Failed with
result 'exit-code'.
Dec 27 00:00:00 xxx-wp2 systemd[1]: Failed to start Rotate log files.

And it appears that /var/log/syslog, which is listed by itself in the
first block of the rsyslog logrotate config, is the only one of those
files getting rotated. So I'll leave my workaround in place:

postrotate
        # /usr/lib/rsyslog/rsyslog-rotate
        /usr/bin/kill -HUP `pgrep rsyslog`
endscript


> Result #3 is
> <https://bugs.launchpad.net/ubuntu/+source/logrotate/+bug/1801910>
> which apparently involves proxmox and claims to have solved the problem
> by installing "rsyslog above on the container", whatever that means.

I had read that thread.

I'm not sure what they mean either, unless they're talking about using
rsyslog on the host, and not in the container at all?

I also note that while my stretch systems have the rsyslog version they
describe, buster has 8.1901.0, which is either much further ahead, or
using a different numbering scheme.

Cheers,

Richard

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: