Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statistics file not available #216

Open
rfmoz opened this issue May 6, 2024 · 3 comments
Open

Statistics file not available #216

rfmoz opened this issue May 6, 2024 · 3 comments

Comments

@rfmoz
Copy link

rfmoz commented May 6, 2024

OpenDKIM 2.11.0~beta2-8 Debian package has these compile options:

override_dh_auto_configure:
        CONFIG_SHELL=/bin/sh dh_auto_configure -- \
                CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
                LDFLAGS="$(LDFLAGS) -Wl,-z,defs -L/usr/lib/libmilter" \
                --disable-live-testing \
                --enable-vbr \
                --enable-rbl \
                --enable-atps \
                --enable-stats \
                --enable-replace_rules \
                --enable-query_cache \
                --enable-sender_macro \
                --with-libmemcached \
                --with-openldap \
                --with-db \
                --with-sql-backend \
                --with-sasl \
                --with-domain=localhost \
                --with-lua \
                $(UNBOUND) \
                $(ODBX}

which generate this binary:

# opendkim -V
opendkim: OpenDKIM Filter v2.11.0
	Compiled with OpenSSL 3.0.11 19 Sep 2023
	SMFI_VERSION 0x1000001
	libmilter version 1.0.1
	Supported signing algorithms:
		rsa-sha1
		rsa-sha256
		ed25519-sha256
	Supported canonicalization algorithms:
		relaxed
		simple
	Active code options:
		QUERY_CACHE
		USE_DB
		USE_LDAP
		USE_LUA
		USE_ODBX
		USE_UNBOUND
		_FFR_ATPS
		_FFR_RBL
		_FFR_REPLACE_RULES
		_FFR_SENDER_MACRO
		_FFR_STATS
		_FFR_VBR
	libopendkim 2.11.0: atps query_cache

Stats looks available, but setting on the configuration file /etc/opendkim/opendkim.conf:

Statistics /var/lib/opendkim/stats.dat

Doesn't produce any stats file. Looking into the fd open by the opendkim worker process, doesn't report it on the list:

/proc/1167052/fd
├── 0 -> /dev/null
├── 1 -> /dev/null
├── 10 -> socket:[620656224]
├── 11 -> socket:[620656225]
├── 2 -> /dev/null
├── 3 -> socket:[620654469]
├── 4 -> socket:[620654477]
├── 5 -> pipe:[620654478]
├── 6 -> pipe:[620654478]
├── 8 -> socket:[620656222]
└── 9 -> socket:[620656223]
@futatuki
Copy link

futatuki commented May 6, 2024

I glanced the code, then it seems opendkim does not create statistics file, but fopen with "a" (append) in dkimf_stats_record() in opendkim/stats.c. Also it reports on failure by using syslog if loging is enabled. Isn't there any error log?

@futatuki
Copy link

futatuki commented May 6, 2024

... it seems opendkim does not create statistics file, but ...

I'm sorry, mode "a" in fopen(3) create the file if it does not exist.

@rfmoz
Copy link
Author

rfmoz commented May 15, 2024

Hi Futatuki,

Restarting via system only produces one line on the log:
2024-05-15T12:15:14.865994+02:00 servername opendkim[3413459]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim/opendkim.conf)

Executing the same instruction via strace, doesn't report any reference, good or bad, to the stats file:
strace -f /usr/sbin/opendkim -x /etc/opendkim/opendkim.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants