[exim-dev] [Bug 1892] New: exim invoked as sendmail keeps lo…

Góra strony
Delete this message
Reply to this message
Autor: admin
Data:  
Dla: exim-dev
Temat: [exim-dev] [Bug 1892] New: exim invoked as sendmail keeps log file open for ever
https://bugs.exim.org/show_bug.cgi?id=1892

            Bug ID: 1892
           Summary: exim invoked as sendmail keeps log file open for ever
           Product: Exim
           Version: 4.87
          Hardware: x86
                OS: Linux
            Status: RESOLVED
          Severity: bug
          Priority: medium
         Component: Logging
          Assignee: nigel@???
          Reporter: arekm@???
                CC: exim-dev@???
        Resolution: DUPLICATE
            Status: RESOLVED


Real live scenario:

        |-crond(3647)-+-run-parts(3650)---cmd.py(5905,nobody)
        |             `-sendmail(3710,exim)



crond starts a process that never ends. cmd.py can be working for months or
years (it is supposed to do so).

cmd.py outputs some data to stdout and crond starts sendmail process to deliver
that output via mail.

The problem is that exim when invoked as sendmail keeps log file open. log file
which is later rotated and deleted but sendmail keeps it open:

sendmail   3710           exim    4w      REG              254,0   5572399  
33635911 /var/log/archive/exim/main.log-20160906 (deleted)


main.log is logrotated via logrotate:
/var/log/exim/main.log {
    olddir /var/log/archive/exim
    create 640 exim exim
    daily
    delaycompress
}


Sending HUP doesn't help:

# lsof 2>&1 | grep 3710 |grep delete
sendmail   3710           exim    4w      REG              254,0   5572399  
33635911 /var/log/archive/exim/main.log-20160906 (deleted)
# kill -HUP 3710
# lsof 2>&1 | grep 3710 |grep delete
sendmail   3710           exim    4w      REG              254,0   5572399  
33635911 /var/log/archive/exim/main.log-20160906 (deleted)


Maybe exim should reopen log if it is rotated?

Like solution seen in WatchedFileHandler in python logging. It simply checks
few things:
if not sres or sres[ST_DEV] != self.dev or sres[ST_INO] != self.ino:
... reopen


Not sure how to approach this (of course I could try to change cmd.py to don't
output anything to stdout/stderr but what cmd.py does currently is perfectly
valid/allowed scenario)

--- Comment #1 from Jeremy Harris <jgh146exb@???> ---


*** This bug has been marked as a duplicate of bug 1891 ***

--
You are receiving this mail because:
You are on the CC list for the bug.