Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 622604

Summary: mail-filter/opendkim ExecStartPre check config
Product: Gentoo Linux Reporter: Garry Filakhtov <filakhtov>
Component: Current packagesAssignee: Ralph Seichter <gentoo>
Status: RESOLVED FIXED    
Severity: enhancement CC: filakhtov, klondike, mjo, net-mail+disabled, proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/11536
Whiteboard:
Package list:
Runtime testing required: ---

Description Garry Filakhtov 2017-06-24 11:40:09 UTC
Hi everyone,

OpenDKIM comes with the config file validation tool that can be used by specifying -n command line option.

I would like to suggest to add
ExecStartPre=/usr/sbin/opendkim -n -x /etc/opendkim/opendkim.conf
to validate config file before start/restart

Thanks in advance.
Regards,
Garry
Comment 1 Michael Orlitzky gentoo-dev 2019-03-27 23:54:46 UTC
Sounds good. We should do this in the OpenRC service file too, in the check_cfg() function.
Comment 2 Michael Orlitzky gentoo-dev 2019-03-29 19:35:14 UTC
Hey Garry, Ralph opened a pull request on github that includes a new systemd service file:

https://github.com/gentoo/gentoo/blob/6fd3891124506865f757e3bf68a4ff689b454461/mail-filter/opendkim/files/opendkim.service.r4

Does that work for you? A real live systemd test would be nice.
Comment 3 Ralph Seichter 2019-03-29 19:43:21 UTC
Ah, Michael beat me to it. ;-) I don't use systemd for Gentoo myself, so your test would be appreciated. In case anybody is wondering about the argument list: The manpage states that 'opendkim -n' will parse both the configuration file and command line arguments.
Comment 4 Garry Filakhtov 2019-03-31 04:31:13 UTC
Hey guys,

Thanks for the update.
Just tested new service file from the mentioned PR and it is looking all good.

Cheers,
Garry
Comment 5 Ralph Seichter 2019-03-31 15:23:16 UTC
Thank you for testing the change, Garry.
Comment 6 Larry the Git Cow gentoo-dev 2019-03-31 19:03:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95a67b7125a6fd3b8ef970d7c6f66b9bec91cfcc

commit 95a67b7125a6fd3b8ef970d7c6f66b9bec91cfcc
Author:     Ralph Seichter <github@seichter.de>
AuthorDate: 2019-03-29 18:45:11 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2019-03-31 19:02:48 +0000

    mail-filter/opendkim: Added pre-start configuration checks
    
    Added pre-start configuration checks for OpenRC and systemd.
    
    Signed-off-by: Ralph Seichter <gentoo@seichter.de>
    Closes: https://bugs.gentoo.org/622604
    Package-Manager: Portage-2.3.62, Repoman-2.3.11
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 mail-filter/opendkim/files/opendkim.init.r6    |  77 +++++++++
 mail-filter/opendkim/files/opendkim.service.r4 |  16 ++
 mail-filter/opendkim/opendkim-2.10.3-r9.ebuild | 223 +++++++++++++++++++++++++
 3 files changed, 316 insertions(+)
Comment 7 Michael Orlitzky gentoo-dev 2019-03-31 19:04:40 UTC
Thanks everyone!