Questions tagged [shutdown]

This refers to the process where the system state is systematically (and preferably gracefully) changed to the fully inactive state. Usually applied to complex systems, such as database, server program, operating system, virtual machine, physical computer and the like. Bypassing the shutdown procedure (immediate termination) may cause data loss or other problems.

This refers to the process where the system state is systematically (and preferably gracefully) changed to the fully inactive state.

Usually applied to complex systems, such as database, server program, operating system, virtual machine, physical computer and the like.

Bypassing the shutdown procedure (immediate termination) may cause data loss or other problems. Once the shutdown sequence has begun it can usually be stopped only by invoking the halt method, which forcibly terminates the system.

1261 questions
43
votes
6 answers

Executing a batch script on Windows shutdown

Is there any way, in Windows 7 Professional, to run a batch script (e.g., a .BAT file) when the user clicks on "shutdown" (not a batch file scheduled to shut down the machine, just one that runs only if the user clicks on "shutdown")? Ideally, such…
PNS
  • 19,295
  • 32
  • 96
  • 143
40
votes
4 answers

shutdown hook for java web application

I need to save some data preferrably when the java web application is stopped, or when tomcat is stopped. how can this be done? Edit: any drawback if I use the jvm shutdown hook?
user121196
  • 30,032
  • 57
  • 148
  • 198
37
votes
6 answers

Programmatically switching off Android phone

Can we switch off an Android phone programmatically? I am using following snippet but it didn't work for me. KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE); KeyguardLock lock =…
Sri Sri
  • 3,107
  • 7
  • 34
  • 37
32
votes
5 answers

Force application close on system shutdown

I have a Windows Forms application that when the Main Window is closing, it displays a basic dialog box, confirming the action. If the user decides to cancel the application exit is cancelled. However, when the application is running minimized and…
Jano Rajmond
  • 455
  • 6
  • 10
26
votes
7 answers

Facing some issues regarding tomcat startup and shutdown on ubuntu 10.04

I am facing some issues regarding tomcat startup and shutdown. I am using Tomcat v.6.0.32 (using the extracted the bundle downloaded from Apache website and not the one distributed by Ubuntu 10.04) Ubuntu v.10.04 I start the tomcat using command:…
Jignesh Gohel
  • 6,236
  • 6
  • 53
  • 89
25
votes
1 answer

Windows 7 remote shutdown: Access denied(5)

I am trying to force a remote shutdown from my laptop to my PC: machine> shutdown -m \\192.168.2.10 -s -f -t 0 192.168.2.10: Access denied(5) I am in a WLAN/LAN environment: Laptop is in WLAN with IP 192.168.2.100 (DHCP), Win 7 (64 bit) PC is…
Gottlieb Notschnabel
  • 9,408
  • 18
  • 74
  • 116
25
votes
7 answers

Best Way to Gracefully Shutdown a Java Command Line Program

I'm interested in different approaches to gracefully shutting down a Java command line program. Sending a kill signal is not an option. I can think of a few different approaches. Open a port and wait for a connection. When one is made, gracefully…
mike boldischar
24
votes
7 answers

How do i shutdown my heroku app?

I've slowly battled through to the point where I have a working Grails app on Heroku. I'm going to bed now so I want to shut it down so I don't continue to use up my 750 free hours of my Dyno. It is probably obvious but I can't find how to shutdown…
Pomum
  • 251
  • 1
  • 2
  • 4
23
votes
0 answers

How to disable the "Chromium didn't shut down correctly" message? Chromium 17, Ubuntu 10.04

I am running Chromium in a kiosk-like environment and if the computer is powered off forcefully while Chromium is running, the next time it boots it will display the message "Chromium didn't shut down correctly. To reopen the pages you had open,…
Daniel M.
  • 3,225
  • 1
  • 22
  • 16
22
votes
3 answers

handling phone shutdown event in android

Could you post a simple code to handle shutdown event. I need manifest and receiver. I need the following: I have a service running in background and I want to detect phone shutting down in order to make it in silent mode so that the terrible…
Ton
  • 9,235
  • 15
  • 59
  • 103
21
votes
10 answers

Shutdown the computer using assembly

How can I shutdown the computer using only assembly code?
haile
21
votes
2 answers

How to properly shutdown java ExecutorService

I have a simple java ExecutorService that runs some task objects (implements Callable). ExecutorService exec = Executors.newSingleThreadExecutor(); List tasks = new ArrayList<>(); // ... create some tasks for (CallableTask task :…
N10
  • 429
  • 2
  • 4
  • 17
21
votes
1 answer

gRPC: What is the recommended way to shut down an asynchronous server in C++?

I have a gRPC server that hosts two asynchronous services ("Master" and "Worker"), and I would like to implement graceful shutdown for the server. Each service has its own grpc::CompletionQueue. There appear to be two Shutdown() methods that might…
mrry
  • 125,488
  • 26
  • 399
  • 400
20
votes
4 answers

How to detect whether Windows is shutting down or restarting

I know that when Windows is shutting down, it sends a WM_QUERYENDSESSION message to each application. This makes it easy to detect when Windows is shutting down. However, is it possible to know if the computer going to power-off or is it going to…
Andrew Garrison
  • 6,977
  • 11
  • 50
  • 77
20
votes
2 answers

What happens when the JVM is terminated?

What happens when the JVM is terminated with System.exit(0) or ^C or anything of that kind? I read things like "the process is just blown away" and "every single thread is stopped", but I would like to know what happens exactly. I already know there…
1
2
3
84 85