【问题标题】:Systemctl service not executed on bootSystemctl 服务未在启动时执行
【发布时间】:2021-08-24 18:18:37
【问题描述】:

我创建了一个简短的脚本来将接口设置为关闭,

[Unit]
Description=Down

[Service]
Type=simple
ExecStart=/usr/bin/base -c 'ifconfig eth0 down'

我已经完成了 systemctl enable,并且 systemctl start 按预期工作以将接口设置为关闭。 但是,在登录后重新启动它并没有执行。我错过了什么吗?

以上是在 RPi4 上使用 64 位版本的 Raspberian OS 完成的。

【问题讨论】:

    标签: systemctl


    【解决方案1】:

    您可能缺少 [Install] 属性吗?

    [Install]
    WantedBy=multi-user.target
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-02
      • 2018-03-29
      • 1970-01-01
      • 2020-11-17
      • 1970-01-01
      相关资源
      最近更新 更多