wrong default config path
Task Info (Flyspray) | |
---|---|
Opened By | Dawid Potocki (dawidpotocki) |
Task ID | 75259 |
Type | Bug Report |
Project | Community Packages |
Category | Packages |
Version | None |
OS | All |
Opened | 2022-07-06 14:23:18 UTC |
Status | Assigned |
Assignee | Sergej Pupykin (sergej) |
Details
Description:
By looking at opendkim.conf(5) we can notice that it is talking about /usr/etc/opendkim.conf 1 which seems just wrong.
Arch's systemd service file has ExecStart=/usr/bin/opendkim $OPENDKIM_FILTER where $OPENDKIM_FILTER set by /etc/conf.d/opendkim OPENDKIM_FILTER="-x /etc/opendkim/opendkim.conf"
This basically makes OpenDKIM change its config file location from the
default set at build-time to /etc/opendkim/opendkim.conf
.
This is the location most people would expect to put their configs.
By just running $ sudo opendkim we will get this output: opendkim: milter socket must be specified (use "-?" for help) but if we do $ sudo mkdir /usr/etc $ echo "blablabla" | sudo tee /usr/etc/opendkim.conf $ sudo opendkim we will get this output: opendkim: /usr/etc/opendkim.conf: configuration error at line 1: unrecognized parameter
This means that OpenDKIM will read the config from this weird location if we provide no flags and it will not read from the location that the systemd service would. This leads to a very inconsistent mess.
Solution:
OpenDKIM's ./configure script has --sysconfdir so all we would need to do to fix this is add it to the PKGBUILD like this:
./configure --prefix=/usr --sbindir=/usr/bin --sysconfdir="/etc/$pkgname" \
--with-db --with-odbx --with-sql-backend --with-openldap
(btw you also need to change git:// in the PKGBUILD to git+https:// cause GitHub disabled git:// 2)
So after rerunning $ sudo opendkim we will get again this output: opendkim: milter socket must be specified (use "-?" for help) because the new config file /etc/opendkim/opendkim.conf doesn't exist. If we create it like we did previously for the previous location $ echo "blablabla" | sudo tee /etc/opendkim/opendkim.conf $ sudo opendkim # this requires sudo because /etc/opendkim is 700 and we would get the previous message we will get: opendkim: /etc/opendkim/opendkim.conf: configuration error at line 1: unrecognized parameter just like we expected.
I believe doing this could also allow us to remove /etc/conf.d/opendkim and $OPENDKIM_FILTER from opendkim.service but I didn't test it.