Hi可以在"oneshot“类型的服务之后运行服务吗
我想运行一个在display-manager.service之前启动但在gpu-manager.service之后启动的脚本,gpu-manager.service是一个检测可用gpu的oneshot服务。这是我的服务:
[Unit]
After=gpu-manager.service
Before=display-manager.service
[Service]
Type=oneshot
ExecStart=myscript
[Install]
WantedBy=multi-user.target我的服务会在gpu管理器之后和显示开始之前启动吗?
发布于 2017-07-08 18:43:24
您确定需要3个服务吗?
您可以使用ExecStop or other指令运行多个脚本并使用1个systemd服务。
[Unit]
Description=example
[Service]
Type=oneshot
ExecStart=/usr/local/bin/on_start.sh
RemainAfterExit=true
ExecStop=/usr/local/bin/with_stopped.sh
[Install]
WantedBy=graphical.targethttps://stackoverflow.com/questions/43403283
复制相似问题