我需要覆盖systemd模板的ExecStart
参数。我已确认单元文件存在并通过验证。添加unique-name@.service.d/override.conf
文件在某些机器上效果很好:
user@prod-west-1604$ systemctl --version | head -1
systemd 229
user@prod-west-1604$ file -b /etc/systemd/system/unique-name@.service
symbolic link to /lib/systemd/system/nginx.service
user@prod-west-1604$ sudo systemctl edit unique-name@.service
# (opens editor as expected)
但是,在运行较新 systemd 版本的机器上,操作会失败:
user@prod-east-1810$ systemctl --version | head -1
systemd 239
user@prod-east-1810$ file -b /etc/systemd/system/unique-name@.service
symbolic link to /lib/systemd/system/nginx.service
user@prod-east-1810$ sudo systemctl edit unique-name@.service
Failed to get the load state of unique-name@.service: Unit name unique-name@.service is neither a valid invocation ID nor unit name.
为什么?