`systemctl reload sendmail` 抛出 `作业类型不适用"

`systemctl reload sendmail` 抛出 `作业类型不适用"

当我尝试使用systemctl重新加载sendmail配置时,出现错误。这是一个错误吗?还是我应该避免尝试systemctl使用sendmail

systemctl教导允许重新加载的推荐方法是什么sendmail.service

请不要在 systemd 上进行宗教争论。

输出systemctl reload sendmail

Failed to reload sendmail.service: Job type reload is not applicable for unit sendmail.service.
See system logs and 'systemctl status sendmail.service' for details.

systemctl status sendmail.service

● sendmail.service - LSB: powerful, efficient, and scalable Mail Transport Agent
   Loaded: loaded (/etc/init.d/sendmail; bad; vendor preset: enabled)
   Active: active (running) since Tue 2016-09-20 15:13:35 CDT; 7h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1476 ExecStart=/etc/init.d/sendmail start (code=exited, status=0/SUCCESS)
    Tasks: 1
   Memory: 3.2M
      CPU: 805ms
   CGroup: /system.slice/sendmail.service
           └─1621 sendmail: MTA: accepting connections

Sep 20 15:48:45 yin.bl-3.com sm-mta[2407]: u8KKmjv5002407: SYSERR(root): btree map "drac": missing map file /var/lib/drac/drac.db: No such file or directory
Sep 20 15:48:45 yin.bl-3.com sm-mta[2407]: u8KKmjv5002407: ruleset=check_rcpt, arg1=<[email protected]>, relay=mx.cableone.net [64.8.70.47], reject=550 5.7.1 <[email protected]>... Relaying denied
Sep 20 15:48:50 yin.bl-3.com sm-mta[2407]: u8KKmjv5002407: from=<>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=mx.cableone.net [64.8.70.47]
Sep 20 15:53:57 yin.bl-3.com sm-mta[2433]: u8KKrvRq002433: SYSERR(root): btree map "drac": missing map file /var/lib/drac/drac.db: No such file or directory
Sep 20 15:53:57 yin.bl-3.com sm-mta[2433]: u8KKrvRq002433: ruleset=check_rcpt, arg1=<[email protected]>, relay=mx.cableone.net [64.8.70.47], reject=550 5.7.1 <[email protected]>... Relaying denied
Sep 20 15:54:02 yin.bl-3.com sm-mta[2433]: u8KKrvRq002433: from=<>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=mx.cableone.net [64.8.70.47]
Sep 20 16:03:45 yin.bl-3.com sm-mta[2503]: u8KL3je5002503: SYSERR(root): btree map "drac": missing map file /var/lib/drac/drac.db: No such file or directory
Sep 20 16:03:45 yin.bl-3.com sm-mta[2503]: u8KL3je5002503: ruleset=check_rcpt, arg1=<[email protected]>, relay=mx.cableone.net [64.8.70.47], reject=550 5.7.1 <[email protected]>... Relaying denied
Sep 20 16:03:50 yin.bl-3.com sm-mta[2503]: u8KL3je5002503: from=<>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=mx.cableone.net [64.8.70.47]
Sep 20 20:02:53 yin.bl-3.com sm-mta[4051]: ruleset=check_relay, arg1=[185.40.4.126], arg2=127.0.0.3, relay=m126.mediumthings.net [185.40.4.126] (may be forged), reject=553 5.3.0 Message From 185.40.4.126 rejected -see http://spamhau
~

答案1

该错误通常意味着客户端程序(在本例中为sendmail)未公开systemctl可供使用的重新加载方法。这是开发人员/维护人员的错误,而不是systemctl。(也许sendmail不能简单地重新加载配置?)

我建议sendmail每当您需要重新加载配置时只需重新启动即可:

sudo systemctl restart sendmail

这将终止它sendmail,然后将其作为新的守护进程实例重新启动。因此,任何新的配置更改都将生效,但您可能会丢失临时数据。

答案2

状态输出已经告诉您一切。

 Docs: man:systemd-sysv-generator(8)

sendmail.service这是描述创建您的单元的特殊方式的手册页。

sendmail.service - LSB: powerful, efficient, and scalable Mail Transport Agent
Loaded: loaded (/etc/init.d/sendmail; bad; vendor preset: enabled)

这些告诉您,rc名为 van Smoorenburg 的脚本/etc/init.d/sendmail被用于自动生成一个sendmail.service单元,并且它被识别为具有一组 LSB 指令(而不是替代指令)。

从 van Smoorenburg 脚本自动生成的服务单元rc不支持重新加载,除非生成器在rc脚本中检测到非常具体的模式字符串。它没有检测到您的脚本,并且不知道如何发出重新加载,或者重新加载对服务根本没有意义。您的旧 van Smoorenburgrc脚本根本没有为服务单元生成器提供信息。

Debian 和 Ubuntu 都不为 Sendmail 提供 systemd 服务单元。如果您需要它们,您必须自己编写一些;或者在某处找到已经编写好的服务单元。

就这么简单。

答案3

试试看systemctl daemon-reload 应该有效

相关内容