Ok
I'd edit the file "/lib/systemd/system/opendkim.service" and correct the lines.
It works fine with this
opendkim Service unavailable
-
- patched
- web4you
- Thread is marked as Resolved.
-
-
Ok. I'll fix the issue after some tests and provide a new version of the plugin.
Thanks for your report and tests.
BTW: Best is to copy the file under /etc/systemd/system and modify the copied file and then, run: systemctl daemon-reload. You shouldn't edit the files under the /lib/systemd directory
-
-
Systemd doesn't accept variables everywhere... and worse, will not resolve variable from the /etc/default/opendkim file. Eg:
Shell-Script- juil. 18 23:46:37 stretch systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
- juil. 18 23:46:37 stretch opendkim[11280]: can't write pid to $RUNDIR/$NAME.pid: No such file or directory
- juil. 18 23:46:37 stretch opendkim[11280]: OpenDKIM Filter: Unable to bind to port local:$RUNDIR/opendkim.sock: No such file or directory
So, we need also fix the default file or use static path in the service file... That a mess...I need to perform some tests...
. -
I end with the folllowing service conffile:
Shell-Script- [Unit]Description=OpenDKIM DomainKeys Identified Mail (DKIM) MilterDocumentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs$After=network.target nss-lookup.target[Service]Type=forkingEnvironmentFile=-/etc/default/opendkim#PIDFile=/var/spool/postfix/var/run/opendkim/opendkim.pidUser=opendkimGroup=opendkimUMask=0007ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u $USER -P $PIDFILE -p $SOCKET#Restart=on-failureExecReload=/bin/kill -USR1 $MAINPID[Install]WantedBy=multi-user.target
which work fine. I had in order to:- Install the service file above under /etc/systemd/system/opendkim.service
- Reload systemd daemon: systemctl daemon-reload
- Set both SOCKET and PIDFILE variables into the /etc/default/opendkim file
- Create the /var/spool/postfix/var/run/opendkim directory with opendkim as ownershop
I'll see if I really need define the PIDFile= parameter in the service file which I would avoid.
Current result:
Shell-Script- root@stretch:/usr/local/src/imscp# service opendkim start && service opendkim status● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) MilterLoaded: loaded (/etc/systemd/system/opendkim.service; enabled; vendor preset: enabled)Active: active (running) since Wed 2017-07-19 00:28:51 CEST; 12ms agoDocs: man:opendkim(8)man:opendkim.conf(5)man:opendkim-genkey(8)man:opendkim-genzone(8)man:opendkim-testadsp(8)man:opendkim-testkeyhttp://www.opendkim.org/docs.htmlProcess: 12865 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u $USER -P $PIDFILE -p $SOCKET (code=exited, status=0/SUCCESS)Main PID: 12866 (opendkim)Tasks: 7 (limit: 4915)CGroup: /system.slice/opendkim.service└─12866 /usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/spool/postfix/var/run/opendkim/opendkim.pid -p local:/var/spool/postfix/var/run/opendkim/opendkim.sockjuil. 19 00:28:51 stretch systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...juil. 19 00:28:51 stretch systemd[1]: Started OpenDKIM DomainKeys Identified Mail (DKIM) Milter.juil. 19 00:28:51 stretch opendkim[12866]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf -u opendkim -P /var/spool/postfix/var/run/opendkim/opendkim.pid -p local:/var/spool/postfix/var/run/opendkim/opendkim.sock)root@stretch:/usr/local/src/imscp#
Shell-Script- root@stretch:/usr/local/src/imscp# ls -la /var/spool/postfix/var/run/opendkim/total 12drwxr-xr-x 2 opendkim root 4096 juil. 19 00:30 .drwxr-xr-x 3 root root 4096 juil. 19 00:13 ..-rw-rw---- 1 opendkim opendkim 6 juil. 19 00:30 opendkim.pidsrwxrwx--- 1 opendkim opendkim 0 juil. 19 00:30 opendkim.sockroot@stretch:/usr/local/src/imscp#
I should probably set socket permissions to 666... or add postfix user to opendkim group, else, Postfix will not be able to connect to the opendkim UDS...Shell-Script- root@stretch:/usr/local/src/imscp# service opendkim stop && service opendkim status
- ● opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
- Loaded: loaded (/etc/systemd/system/opendkim.service; enabled; vendor preset: enabled)
- Active: inactive (dead) since Wed 2017-07-19 00:29:16 CEST; 25ms ago
- Docs: man:opendkim(8)
- man:opendkim.conf(5)
- man:opendkim-genkey(8)
- man:opendkim-genzone(8)
- man:opendkim-testadsp(8)
- man:opendkim-testkey
- http://www.opendkim.org/docs.html
- Process: 12865 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u $USER -P $PIDFILE -p $SOCKET (code=exited, status=0/SUCCESS)
- Main PID: 12866 (code=exited, status=0/SUCCESS)
- juil. 19 00:28:51 stretch systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
- juil. 19 00:28:51 stretch systemd[1]: Started OpenDKIM DomainKeys Identified Mail (DKIM) Milter.
- juil. 19 00:28:51 stretch opendkim[12866]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf -u opendkim -P /var/spool/postfix/var/run/opendkim/opendkim.pid -p l
- ocal:/var/spool/postfix/var/run/opendkim/opendkim.sock)
- juil. 19 00:29:15 stretch systemd[1]: Stopping OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
- juil. 19 00:29:16 stretch opendkim[12866]: OpenDKIM Filter: mi_stop=1
- juil. 19 00:29:16 stretch opendkim[12866]: OpenDKIM Filter v2.11.0 terminating with status 0, errno = 0
- juil. 19 00:29:16 stretch systemd[1]: Stopped OpenDKIM DomainKeys Identified Mail (DKIM) Milter.
- root@stretch:/usr/local/src/imscp#
-
-
-
Thank you for your feedback.
In fact, I want change the path only for consistency with the other services. For instance, in previous i-MSCP versions, the /var/run/courier/authdaemon directory was mounted into the /var/spool/postfix/private/authdaemon directory but with the new Postfix versions, the /etc/postfix/postfix-script check for ownership of directory/file stored inside its directories and raises warnings such as:
Shell-Script- Jul 19 08:42:32 stretch postfix/postfix-script[16999]: warning: not owned by postfix: /var/spool/postfix/private/authdaemon
- Jul 19 08:42:32 stretch postfix/postfix-script[17000]: warning: not owned by postfix: /var/spool/postfix/private/authdaemon/pid
- Jul 19 08:42:32 stretch postfix/postfix-script[17001]: warning: not owned by postfix: /var/spool/postfix/private/authdaemon/pid.lock
- Jul 19 08:42:32 stretch postfix/postfix-script[17031]: starting the Postfix mail system
- Jul 19 08:42:32 stretch postfix/master[17033]: daemon started -- version 3.1.4, configuration /etc/postfix
when the directory/files are not owned by the postfix user.
So yes, for the /var/spool/postfix/opendkim directory, there is no problem as this directory doesn't directly belong to Postfix but, I just like to be consistent:
- /var/spool/postfix/var/run/courier/authdaemon directory
- /var/spool/postfix/var/run/opendkim directory
- ...
In short, the layout should be in my eyes: <POSTFIX_CHROOT_PATH>/<SERVICE_RUNDIR_PATH>
-
-
-
You have to change this manually or is the next update corrected?
-
-
You have to change this manually or is the next update corrected?
Please open your eyes. The thread is still set with to be fixed.