为什么"ExecStart="在customexec.config(Varnish Cache)中定义了两次?

Why is "ExecStart=" defined twice in customexec.config (Varnish Cache)?

为什么ExecStart=定义了两次,为什么第一次是空的?是不是因为varnish会启动两个进程,一父一子?如果是这样,我在哪里可以阅读它? 我似乎找不到任何关于此的信息。

在 Varnish 自己的文档中,一次又一次地跨版本,这是指令:

来源:https://varnish-cache.org/docs/trunk/tutorial/putting_varnish_on_port_80.html

根据https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=

Unless Type= is oneshot, exactly one command must be given. When Type=oneshot is used, zero or more commands may be specified. Commands may be specified by providing multiple command lines in the same directive, or alternatively, this directive may be specified more than once with the same effect. If the empty string is assigned to this option, the list of commands to start is reset, prior assignments of this option will have no effect. If no ExecStart= is specified, then the service must have RemainAfterExit=yes and at least one ExecStop= line set. (Services lacking both ExecStart= and ExecStop= are not valid.)

长话短说:

  • 所有出现的 ExecStart 都被执行,除非 Type=oneshot
  • 通过设置 ExecStart=,我们确保删除以前的值
  • 再次设置ExecStart为实际值,将只执行此命令