You are not logged in.

#1 2017-08-18 08:59:51

Zobel92
Member
Registered: 2017-08-11
Posts: 6

Auto-Shutdown

Hi,

I am searching for a solution to auto-shutdown my ArchLinux when a specific program closes. How can I put this into action? My search wasn't successful unfortunately.

Offline

#2 2017-08-18 09:06:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: Auto-Shutdown

Create a launch script and add the program as well as the relevant shutdown command into it. As it stands this is very much an XY problem. provide details as to why you want to do this, for what purpose, which programs are going to be involved and show an attempt at solving that is unsatisfactory, should my first sentence not be enough.

Offline

#3 2017-08-18 10:11:40

Zobel92
Member
Registered: 2017-08-11
Posts: 6

Re: Auto-Shutdown

I want to run a Windows-VM on an Arch Linux System. The computer should be used by laypeople. The Windows-VM solution is to protect the computer. For the laypeople it should feel like a normal windows, and for that I created an autostart script, that the VM will automatically started, if the computer boots. And now I want, that the computer shuts down if the Windows-VM shuts down, too. Can I add a waiting order in the openbox-autostart script? And shut down the computer, if the autostart script isn't waiting for the qemu anymore?

Offline

#4 2017-08-18 10:50:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: Auto-Shutdown

Yes that should work, go ahead and try, if it doesn't work come back with exact details on how and where you have added relevant adjustments, post your script, don't be a help vampire

Offline

#5 2017-08-18 14:30:34

Zobel92
Member
Registered: 2017-08-11
Posts: 6

Re: Auto-Shutdown

This is the code from the openbox autostart file which works how I want it:

qemu-system-x86_64 --enable-kvm -cpu host -smp 2 -drive file=/vm/win10,format=qcow2 -m 3072
wait %1
systemctl poweroff

Thank you wink

Last edited by Zobel92 (2017-08-18 14:31:32)

Offline

#6 2017-08-18 14:38:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: Auto-Shutdown

Please mark as solved by editing the title of your initial post.

Offline

Board footer

Powered by FluxBB