Gio*_*Mac 5 fedora virtualbox init systemd
当我启动“重新启动”或“关机”时,systemd 正在终止所有进程,但我需要它等待一个特定的应用程序完成,然后再停止其他服务。
实际上,我想要 Virtualbox vm clean shutdown/savestate。使用此服务文件手动执行没有问题,但在关闭期间 - 进程被终止。我怎样才能控制它?
我已经阅读了文档,但没有找到这种依赖的明确解决方案。
[Unit]
Description=virtualbox vm1 vm control service
After=vboxweb-service.service
Before=shutdown.target
[Service]
Type=oneshot
ExecStart=/usr/bin/VBoxManage startvm vm1 -type vrdp
ExecStop=/usr/bin/VBoxManage controlvm vm1 savestate
RemainAfterExit=true
Run Code Online (Sandbox Code Playgroud)
解决了。
[Unit]
Description=virtualbox windows vm control service
After=vboxweb-service.service
Before=shutdown.target reboot.target halt.target
[Service]
Type=oneshot
ExecStart=/usr/bin/VBoxManage startvm windows -type vrdp
ExecStop=/usr/bin/VBoxManage controlvm windows savestate
RemainAfterExit=true
KillMode=none
[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
8916 次 |
最近记录: |