Shutting down the current operating system. This may power down the physical hardware but may also just inactivate a virtual machine.
Questions tagged [system-shutdown]
112 questions
55
votes
3 answers
How to detect Windows shutdown or logoff
I need to detect when Windows is shutdown (or restarted) or when the user is logging off. I need to properly close the application before the application is closed.
I noticed that no exit application event is raised when Windows is closing day.
I…

Andrea Nagar
- 1,233
- 2
- 13
- 23
26
votes
10 answers
How to detect pending system shutdown on Linux?
I am working on an application where I need to detect a system shutdown.
However, I have not found any reliable way get a notification on this event.
I know that on shutdown, my app will receive a SIGTERM signal followed by a SIGKILL. I want to…

341008
- 9,862
- 11
- 52
- 84
19
votes
10 answers
shutting down computer (linux) using python
I am trying to write a script that will shut down the computer if a few requirements are filled with the command
os.system("poweroff")
also tried
os.system("shutdown now -h")
and a few others. but nothing happens when I run it, the computer goes…

user3522859
- 193
- 1
- 1
- 6
17
votes
5 answers
Run a script only at shutdown (not log off or restart) on Mac OS X
Is there any way to run a script only at shutdown?
I mean, only when the computer is really shutting down to off state. This script should not run when doing just a log off or restart.

Audio01
- 173
- 1
- 1
- 5
15
votes
2 answers
How to power down the computer from a freestanding environment?
I'm making a protected-mode OS based on Intel's x86 architecture, and was looking for some information on how to power off the computer via assembly code, or something like that. Could you help me with this problem?

Carlos
- 151
- 1
- 3
12
votes
5 answers
Detect pending linux shutdown
Since I install pending updates for my Ubuntu server as soon as possible, I have to restart my linux server quite often. I'm running an webapp on that server and would like to warn my users about the pending restart. Right now, I do this manually,…

iGEL
- 16,540
- 11
- 60
- 74
11
votes
3 answers
How to shutdown the machine? I'm building a tiny OS of my own
Can the hlt instruction in assembly shutdown a computer it as it halts the processor? if it can be done using what i have told, is it the right way?
Can hlt shutdown the machine?
start:
xor ax, ax; ;clear ax
mov bx, ax; ;clear bx
cli…

manuhg
- 360
- 1
- 4
- 16
11
votes
3 answers
How to fix "Google Chrome did not shutdown properly" in Windows 8.1
When shutting down Windows 8.1, Google Chrome produces the error message "Google Chrome did not shutdown properly". How can I get Chrome to shut down without giving me that error message?
I don't have to be logged in as a Google user.

user3237328
- 111
- 1
- 1
- 4
11
votes
1 answer
Is there any API function for shutting down Windows while installing any pending updates?
I know the ExitWindowsEx() API function which simply shuts down Windows. But as far as I know, you cannot make Windows install any pending updates with it.
Is there any API support for installing any pending updates (in that standard blue screen…

hkBattousai
- 10,583
- 18
- 76
- 124
10
votes
5 answers
Detecting a scheduled shutdown
I have a cmd script that will execute a set of patches, and it's designed to abort if a reboot is required to avoid patching issues. I'd also like to extend the script to abort if a reboot is scheduled (E.g. via the "shutdown" command) in order to…

Ificator
- 101
- 1
- 1
- 3
9
votes
2 answers
How to abort shutdown in Windows (XP|Vista) programatically?
I want to be able to 1. detect (and, if needed 2. abort) OS shutdown from my application, preferably by using the Windows API.
I know that it is possible to abort shutdown manually using the command shutdown -a In the worst case, I could…

Piskvor left the building
- 91,498
- 46
- 177
- 222
9
votes
3 answers
C# - How to detect a Windows shutdown/logoff and cancel that action (after asking the user)
Some explanation: for a project I'm working on I have to write a program that is running in the background, detects changes to files, and uploads the modified files to a web service to make it available to others. Quite simple synchronization if it…

Sébastien Nussbaumer
- 6,202
- 5
- 40
- 58
7
votes
2 answers
Shutdown another System using shutdown.exe in C#?
I use the following code for shutdown the own System.It was working Fine.And I need to shut down another System, which is connected in LAN Connection. I'm unable to do it with this code. How to Shutdown another System using shutdown.exe? My OS is…

V.V
- 875
- 3
- 25
- 54
6
votes
1 answer
filesystem are unmounted before the services are stopped in systemd
I am debugging systemd shutdown issue. Here the problem is some of the filesystems are unmounted while the services are still running.
In general, we want systemd to shutdown the services first and then umount the mount points.
But here, umount and…

sandeep nagendra
- 422
- 5
- 15
6
votes
3 answers
Arch Linux / systemd - prevent any kind of shutdown/rebboot
I'm running Arch-based Manjaro Linux and wrote myself a little update program, that starts every 7 hours and runs completely in the background. This update program is started by systemd.
What I wanna know is: How can I prevent any system…

Markus Sommerbauer
- 63
- 4