You are not logged in.

#1 2016-10-18 05:51:28

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

[SOLVED] Opendmarc - unable to write in /run

I'm trying to make opendmarc successfully start on boot.
Currently, I have to manually create a directory "/run/opendmarc" and give it the necessary permissions for it to run.

The config would be this:

AuthservID	mail.<mydomain>
Socket		local:/run/opendmarc/dmarc.sock
PidFile		/var/run/opendmarc/opendmarc.pid
HistoryFile	/var/run/opendmarc/opendmarc.dat
UserID		opendmarc:postfix
Syslog		true
UMask		0002

The service file is the default one, haven't touched it yet.

[Unit]
Description=OpenDMARC
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
ExecStart=/usr/bin/opendmarc -c /etc/opendmarc/opendmarc.conf
Restart=always

[Install]
WantedBy=multi-user.target

I tried with root:root in the config file, I tried even without specifying a UserID, still no luck.
Pretty sure this is not tested well enough, but then again, it could be just me.
When I have time, I'll try to look into the source code and see if there's actually code that makes that directory if needed or it just waits for it to be there.

Any thoughts on this one?

Last edited by smirky (2016-10-26 06:20:16)


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

#2 2016-10-18 10:40:28

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Opendmarc - unable to write in /run

This would normally be handled with a RuntimeDirectory directive in the service file (or with tmpfiles.d).

Offline

#3 2016-10-18 17:24:44

smirky
Member
From: Bulgaria
Registered: 2013-02-23
Posts: 277
Website

Re: [SOLVED] Opendmarc - unable to write in /run

@Raynman - Thank you!
I learned about /etc/tmpfiles.d/ which turned out exactly what I needed.

 0 « root » ~ » cat /etc/tmpfiles.d/opendmarc.conf 
D /run/opendmarc 0750 opendmarc postfix

I actually found there's an opendkim.conf file in there for "opendkim" and I just copied it, modified it as the above cat shows and now it survives reboot.
Did some more research on opendkim, to see how it handles that, but I didn't find anything in the PKGBUILD or the install hook:

https://git.archlinux.org/svntogit/comm … s/opendkim

Perhaps I'm missing something? How did that file get in there in the first place?
If I find that out, I can request a change for "opendmarc" too.

EDIT:

What's even stranger is this:

 0 « root » /etc/tmpfiles.d » pacman -Qo *
error: No package owns opendkim.conf
error: No package owns opendmarc.conf

Really confusing!

Last edited by smirky (2016-10-18 17:26:50)


Personal spot  ::  https://www.smirky.net/  ::  Try not to get lost!

Offline

Board footer

Powered by FluxBB