这是一个脚本:
#!/bin/bash
setterm --blank 1 --powerdown 2这是服务:
[Unit]
Description=Blank screen after 1 min and turn it off after 2 min. Any keypress will turn it back on.
After=ssh.service
[Service]
Type=oneshot
Environment=TERM=linux
StandardOutput=tty
TTYPath=/dev/console
ExecStart=/home/USER/.boot-scripts/screen-off.sh
[Install]
WantedBy=local.target如果我启用它并启动它,它就能工作,但是当我重新启动服务器时,什么都没有发生。如果我验证了服务的状态,这就是我得到的:
● screen-off.service - Blank screen after 1 min and turn it off after 2 min. Any keypress will turn it back on.
Loaded: loaded (/etc/systemd/system/screen-off.service; enabled; vendor preset: enabled)
Active: inactive (dead)你知道为什么它不是在启动时启动的吗?我必须手动启动?
谢谢
发布于 2021-07-27 18:01:04
感谢- user535733 (我错误地删除了注释)的帮助,local.target不是Ubuntu系统引导路径上的正常系统目标。我把它移到多用户。目标,现在开始工作了!
https://askubuntu.com/questions/1354415
复制相似问题