Pha*_*aoh 6 debian configuration services init.d
这一切都在 Debian 测试中(= Stretch 截至目前)。
我正在尝试配置opendkim,但它不会使用我想要的套接字。
根据man opendkim.conf,Socket可以在/etc/opendkim.conf.
我也尝试创建/etc/default/opendkim我在 Jessie 框中看到的文件,但这也不起作用。
因此,我尝试在以下行中输入/etc/opendkim.conf:
Socket inet:39172@localhost
Run Code Online (Sandbox Code Playgroud)
现在,根据/etc/init.d/opendkim,读取此文件:
if [ -f /etc/opendkim.conf ]; then
CONFIG_SOCKET=`awk '$1 == "Socket" { print $2 }' /etc/opendkim.conf`
fi
Run Code Online (Sandbox Code Playgroud)
对我来说,到目前为止看起来不错。但是下面的代码片段,紧随其后,似乎转储了现在已读取的信息:
# This can be set via Socket option in config file, so it's not required
if [ -n "$SOCKET" -a -z "$CONFIG_SOCKET" ]; then
DAEMON_OPTS="-p $SOCKET $DAEMON_OPTS"
fi
DAEMON_OPTS="-x /etc/opendkim.conf -u $USER -P $PIDFILE $DAEMON_OPTS"
Run Code Online (Sandbox Code Playgroud)
我真的不明白这应该做什么。$CONFIG_SOCKET实际上从未用于 start opendkim,是吗?为什么首先要从配置文件中读取呢?
我注意到还有一个文件/etc/systemd/system/multi-user.target.wants/opendkim似乎没有加载任何配置。
如果它有任何重要性:要重新启动opendkim,我输入service opendkim restart。
我检查套接字是否已被读取是:
telnet localhost 39172说Connection refused和/var/log/syslog说:
opendkim[8343]: OpenDKIM Filter v2.11.0 starting (args: -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock)
Run Code Online (Sandbox Code Playgroud)
我的问题是: 我应该如何在 Debian Testing/Stretch 上为 opendkim 配置套接字?
这可能也解决了上面脚本应该如何工作的谜团。
小智 5
当然,编辑 systemd 单元并不是最佳实践。我们应该这样做:
sudo systemctl edit opendkim
Run Code Online (Sandbox Code Playgroud)
并插入:
[Service]
ExecStart=
ExecStart=/usr/sbin/opendkim -P /var/run/opendkim/opendkim.pid -p local:/var/spool/postfix/opendkim/opendkim.sock
Run Code Online (Sandbox Code Playgroud)
(注意双 ExecStart - 这不是拼写错误)
小智 5
您正在正确配置它,但这是 Debian Stretch 的一个开放错误,它忽略了配置:
请参阅:https : //bugs.debian.org/cgi-bin/bugreport.cgi?bug=864162
| 归档时间: |
|
| 查看次数: |
7878 次 |
| 最近记录: |