How-to: Change listener_module Logrotate Config

Change listener_module Logrotate Configuration

Environment

UCS System with listener_modules (e.g. ox-connector), of which you want to modify the logrotate configuration

Process

Step 1: Get the listener module name

root@ucs-7794:~# univention-directory-listener-ctrl modules | grep ox
3       dovecot-functional-account      /usr/lib/univention-directory-listener/system/dovecot_ox_functional_account.py
3       ox-connector    /usr/lib/univention-directory-listener/system/ox-connector.py

=> we want ox-connector

Step 2: Configure the wanted settings

Set the rotate frequency (e.g. to daily)

ucr set logrotate/listener-modules/ox-connector/rotate=daily

For supported values please check:
https://linux.die.net/man/8/logrotate

Set the number of logs to keep (e.g. to 60)

ucr set logrotate/listener-modules/ox-connector/rotate/count=60

Disables compression

ucr set logrotate/listener-modules/ox-connector/compress=false

Disables missingok (logfile needs to be present)

ucr set logrotate/listener-modules/ox-connector/missingok=false

Disables notifempty

ucr set logrotate/listener-modules/ox-connector/notifempty=false

Change permissions of created log

ucr set "logrotate/listener-modules/ox-connector/create=600 root adm"

Step 3: Verify configuration

You can check the generated configuration at /etc/logrotate.d/listener-modules

1 Like