mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.

Home Page:https://mailinabox.email/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NSD daemon fails to log into /var/log/ directory

skoszewski opened this issue · comments

Hi there!

I have upgraded my box to the v64 after updating the VPS to the 22.04 LTS. Immediately I have noticed that the NSD daemon fails to write to /var/log directory.

It seams the issue is related to two missing configuration actions:

  • The nsd account is not in the syslog group
  • The nsd.service file does not list /var/log as writable directory for the process

I have added the nsd to the syslog group and modified the /lib/systemd/system/nsd.service file. I have also added package divertion for that file, so it will not be overwritten by the future updates.

Is it worth creating a patch and a pull request (I can do that)? Or am I missing something and it was by design not a bug?

Kind regards,
Slawomir

What I did was set log-only-syslog: yes in nsd.conf and ensure that nsd.log exists before starting nsd. You might be able to get away with just the latter, but am not sure off hand.

So, two changes in setup/nsd.sh.

Somewhere in the cat > /etc/nsd/nsd.conf section, add log-only-syslog: yes.

And, after the terminal EOF add:

# nsd.log must exist or rsyslog won't write to it
if [ ! -e /var/log/nsd.log ]; then
    touch /var/log/nsd.log
    chown syslog:adm /var/log/nsd.log
fi

Confirmed behavior, and it seems unintended.

Also confirming that the above code change resolved the immediate issue, however... I haven't had enough time to determine if log rotation will work too.