我已isc-dhcp-server-ldap
在 OpenLDAP 中安装并保留了我的 DHCP 配置。这很完美。
但是,当我重新启动服务器时,isc-dhcp-server
它并没有启动:
s-hrt1# systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● isc-dhcp-server.service loaded failed failed ISC DHCP IPv4 server
● systemd-random-seed.service loaded failed failed Load/Save Random Seed
● systemd-rfkill.service loaded failed failed Load/Save RF Kill Switch Status
● systemd-rfkill.socket loaded failed failed Load/Save RF Kill Switch Status /dev/rfkill Watch
journalctl -xeu isc-dhcp-server
显示如下消息:
Jun 20 06:07:36 s-hrt1 dhcpd[703]: Cannot set LDAP TLS crl check option: Can't contact LDAP server
如果我手动重新启动,isc-dhcp-server
就systemctl restart
不会出现任何问题。
我假设slapd
OpenLDAP 服务器在启动时尚未准备就绪isc-dhcp-server
。我如何告诉其在启动前systemd
等待?slapd
isc-dhcp-server
答案1
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requires=
文档说如果您想控制顺序,您必须使用Requires
与的组合Before/After
。
我认为它是这样的:
[Unit]
Description=Start isc-dhcp-server
Requires=slapd.service
After=slapd.service```