install opendkim

Issues related to applications and software problems and general support
User avatar
KernelOops
Posts: 428
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: install opendkim

Post by KernelOops » 2020/01/09 06:15:17

Did you modify the /etc/opendkim.conf? Did you check that there are no SELinux avc errors?

Take a look at this config template, it should look like this:

Code: Select all

PidFile			/var/run/opendkim/opendkim.pid
Mode			sv
Syslog			yes
SyslogSuccess		yes
LogWhy			no
UserID			opendkim:opendkim
Socket			inet:8891@localhost
Umask			002
SendReports		no
SoftwareHeader		no
Canonicalization	relaxed/simple
Domain			*
Selector		default
MinimumKeyBits		1024
KeyFile			/etc/opendkim/keys/default.private
InternalHosts		refile:/etc/opendkim/TrustedHosts
OversignHeaders		From
On-BadSignature		reject
#On-KeyNotFound		reject
On-Security		reject
In this case, the socket is setup as a TCP port 127.0.0.1:8891, instead of an actual socket. This also avoid any potential SELinux problems.
--
R.I.P. CentOS :cry:
--

User avatar
young_nandy
Posts: 33
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/13 07:06:25

configuration opendkim.conf has problems. there is an error as below


● opendkim.service - LSB: Start and stop OpenDKIM
Loaded: loaded (/etc/rc.d/init.d/opendkim; generated)
Active: failed (Result: exit-code) since Mon 2020-01-13 14:03:33 WIB; 6s ago
Docs: man:systemd-sysv-generator(8)
Process: 14281 ExecStart=/etc/rc.d/init.d/opendkim start (code=exited, status=0/SUCCESS)
Main PID: 14290 (code=exited, status=69)
Tasks: 4 (limit: 11525)
Memory: 4.6M
CGroup: /system.slice/opendkim.service
├─12178 /usr/local/sbin/opendkim -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid
└─12180 /usr/local/sbin/opendkim -x /etc/opendkim.conf -P /var/run/opendkim/opendkim.pid

Jan 13 14:03:33 ayopromo systemd[1]: opendkim.service: Found left-over process 12178 (opendkim) in control group while starting unit. Ignoring.
Jan 13 14:03:33 ayopromo systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Jan 13 14:03:33 ayopromo systemd[1]: opendkim.service: Found left-over process 12180 (opendkim) in control group while starting unit. Ignoring.
Jan 13 14:03:33 ayopromo systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Jan 13 14:03:33 ayopromo systemd[1]: Starting LSB: Start and stop OpenDKIM...
Jan 13 14:03:33 ayopromo opendkim[14281]: Starting OpenDKIM Milter: [ OK ]
Jan 13 14:03:33 ayopromo systemd[1]: Started LSB: Start and stop OpenDKIM.
Jan 13 14:03:33 ayopromo systemd[1]: opendkim.service: Main process exited, code=exited, status=69/UNAVAILABLE
Jan 13 14:03:33 ayopromo systemd[1]: opendkim.service: Failed with result 'exit-code'.
[root@ayopromo opendkim-2.11.0]# journalctl -xe
Jan 13 14:03:33 ayopromo systemd[1]: opendkim.service: Main process exited, code=exited, status=69/UNAVAILABLE
Jan 13 14:03:33 ayopromo opendkim[14292]: smfi_opensocket() failed
Jan 13 14:03:33 ayopromo systemd[1]: opendkim.service: Failed with result 'exit-code'.
Jan 13 14:03:33 ayopromo opendkim[14290]: exited with status 69, restarting
Jan 13 14:03:33 ayopromo opendkim[14293]: OpenDKIM Filter: Unable to bind to port inet:8891@127.0.0.1: Address already in use
Jan 13 14:03:33 ayopromo opendkim[14293]: OpenDKIM Filter: Unable to create listening socket on conn inet:8891@127.0.0.1
Jan 13 14:03:33 ayopromo opendkim[14293]: smfi_opensocket() failed

User avatar
KernelOops
Posts: 428
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: install opendkim

Post by KernelOops » 2020/01/13 07:28:43

does not look like a big deal, it seems as if something is preventing opendkim from opening the port number 8891.

either you have something already listening on port 8891, or SELinux prevents opendkim from opening the port.

check your avc errors with grep -i avc /var/log/audit/audit.log and see if there are relevant entries, then use audit2why and audit2allow to create an exception for opendkim and port 8891.
--
R.I.P. CentOS :cry:
--

User avatar
young_nandy
Posts: 33
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/13 10:39:49

At first I thought so too, but after I check below it seems that the problem is not that

[ayopromo@ayopromo run]$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 763/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1299/master
tcp 0 0 127.0.0.1:8891 0.0.0.0:* LISTEN 1918/opendkim
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 1141/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 1141/dovecot
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 1299/master
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 837/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1299/master
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 1141/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 1141/dovecot
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 766/perl
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 1299/master
tcp6 0 0 :::22 :::* LISTEN 763/sshd
tcp6 0 0 :::25 :::* LISTEN 1299/master
tcp6 0 0 :::993 :::* LISTEN 1141/dovecot
tcp6 0 0 :::995 :::* LISTEN 1141/dovecot
tcp6 0 0 :::587 :::* LISTEN 1299/master
tcp6 0 0 :::110 :::* LISTEN 1141/dovecot
tcp6 0 0 :::143 :::* LISTEN 1141/dovecot
tcp6 0 0 ::1:783 :::* LISTEN 766/perl
tcp6 0 0 :::465 :::* LISTEN 1299/master
udp 0 0 10.0.4.15:68 0.0.0.0:* 748/NetworkManager
[ayopromo@ayopromo run]$

User avatar
young_nandy
Posts: 33
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/13 13:09:59

The opendkim service runs after restarting and changing the configuration in opendkim.conf

socket inet: 8891 @ localhost

changed into

inet socket: 8891@127.0.0.1

but another problem arises like this

1. the opendkim folder used for PID in / var / run will disappear when the operating system is restarted. and must create a new opendkim folder.

2. Open Service will not work if you make autorun or enable the service.

code:

/ usr / lib / systemd / systemd-sysv-install enable opendkim

is there a solution to these problems?

User avatar
KernelOops
Posts: 428
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: install opendkim

Post by KernelOops » 2020/01/13 15:34:06

I don't know what Open Service is... and the command "systemd-sysv-install" is obviously wrong. I don't know where you got that from but thats not how systemd works with compatible packages.

/var/run (or just /run) is for temporary storage of running processes (like PID files), so things there are meant to disappear.

To enable opendkim:

systemctl enable opendkim

To start opendkim:

systemctl start opendkim

To get the status of the currently running opendkim

systemctl status opendkim


It seems opendkim is already running and you are trying to re-run it via that command, which is wrong.
--
R.I.P. CentOS :cry:
--

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: install opendkim

Post by TrevorH » 2020/01/13 16:06:32

1. the opendkim folder used for PID in / var / run will disappear when the operating system is restarted. and must create a new opendkim folder.
Report it as a bug in the opendkim package you are using - it should be including a tmpfiles.d conf file to create that dir on reboot.

And if you're not using a packaged version, why not?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
young_nandy
Posts: 33
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/14 04:43:44

KernelOops wrote:
2020/01/13 15:34:06
I don't know what Open Service is... and the command "systemd-sysv-install" is obviously wrong. I don't know where you got that from but thats not how systemd works with compatible packages.

/var/run (or just /run) is for temporary storage of running processes (like PID files), so things there are meant to disappear.

To enable opendkim:

systemctl enable opendkim

To start opendkim:

systemctl start opendkim

To get the status of the currently running opendkim

systemctl status opendkim


It seems opendkim is already running and you are trying to re-run it via that command, which is wrong.

when I use the "systemctl enable opendkim" command, an error occurs and it is recommended to use that command.

User avatar
young_nandy
Posts: 33
Joined: 2019/09/30 01:28:15

Re: install opendkim

Post by young_nandy » 2020/01/14 04:51:41

TrevorH wrote:
2020/01/13 16:06:32
1. the opendkim folder used for PID in / var / run will disappear when the operating system is restarted. and must create a new opendkim folder.
Report it as a bug in the opendkim package you are using - it should be including a tmpfiles.d conf file to create that dir on reboot.

And if you're not using a packaged version, why not?
I can't say this is a bug yet. I rather think that this is the wrong configuration.

User avatar
KernelOops
Posts: 428
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: install opendkim

Post by KernelOops » 2020/01/14 06:01:14

I am guess, your rpm package is not properly made for CentOS 8.
--
R.I.P. CentOS :cry:
--

Post Reply