A graceful termination of the application, either in response to some input or by internal logic. Usually applied for applications that need to run certain code in order to terminate in consistent way.
Questions tagged [application-shutdown]
170 questions
0
votes
0 answers
Remove Shutdown Hook of another Java process
I have a Java application that I want to shutdown gracefully in Windows. I am starting this application using a .bat file and I am able to stop it gracefully if I press CTRL+C from keyboard. Sending a SIGINT/SIGTERM signal to an application is easy…

blu3
- 123
- 1
- 12
0
votes
1 answer
Difficulties with the handling of files after shutdown or reboot
I wrote a little application which is able to log some data and writes it via ofstream into a file:
ofstream filename;
filename.open("filename.ext", ios::out | ios::app);
filename << stuff;
This file is closed and re-opened every…

Quallon
- 94
- 1
- 11
0
votes
1 answer
In Wildfly 9 is there a way to suspend only certain MDB
I am able to call :suspend and :resume from the cli, however, this suspends all beans (EJB, MDB). Is there a way to only suspend message driven beans MDBs?
In my application all the work comes in via messages. If I can suspend the message…

Vijay Kumar
- 2,439
- 2
- 32
- 51
0
votes
1 answer
CEF framework sending http request before close
I want to shut down server on window close (CEFsimple close) by sending http request to localhost:5000/shutdown.
I belive this should do the job
browser->GetMainFrame()->LoadURL("http://127.0.0.1:5000/shutdown/");
So, where is the right place to…

grabhints
- 680
- 8
- 23
0
votes
2 answers
Stop Java Process if Running in Raspbian
I want to make sure that a java process in Raspbian is stopped before launching a new instance of it.
My approach, until now, has been to try to create a one-line command to stop the process from the command line, as it is the easiest way to include…

eversor
- 3,031
- 2
- 26
- 46
0
votes
2 answers
What does WIX's CloseApplication functionality do and how would can the application respond to such a signal
In the WIX setup I've got, when upgrading the application I have set a requirement to close down applications which might hold on to files which needs to be updated:

tronda
- 3,902
- 4
- 33
- 55
0
votes
1 answer
execute task only on ctrl^C (Runtime.getRuntime().addShutdownHook(Thead t) )
I'm developing a project which has complete java code & SQL, where the application kicks-off from the shell script.
I want to execute some cleanup task (closing transactions n logging abrupt message) when a user press Ctrl^C.
I tried with adding…

anji_rajesh
- 369
- 2
- 11
0
votes
3 answers
Proper way to shut down socket server in WinForms application?
I'm working on a basic socket server in C# that needs to run as part of a Windows Forms application. I started with the asynchronous socket server code from MSDN. Like many socket server code samples, this one is a console mode application. …

bmt22033
- 6,880
- 14
- 69
- 98
0
votes
3 answers
How can I cleanly shortcircuit my app from a canceled login form, and invoke my main form when login is successful?
I have a login form that displays prior to the main form, using this code in Program.cs:
static void Main()
{
AppDomain.CurrentDomain.UnhandledException += Unhandled;
frmLogin loginForm;
using (loginForm = new frmLogin())
{
…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
2 answers
How to interrupt Eclipse RCP shutdown
I have a plugin into an eclipse rcp application. I need to detect a scenario whenever a particular perspective is closed or if the application is closed and based on the outcome, I may need to cancel the closing of the app or perspective. If I had…

Doug
- 21
- 1
- 3
0
votes
2 answers
jna call to kernel32.CreateToolhelp32Snapshot in shutdown hook crashes the VM
If a thread sets a shutdown hook using
Runtime.getRuntime().addShutdownHook();
calls via jna the method:
kernel32.CreateToolhelp32Snapshot (0x00000002, 0)
it crashes the VM.
If I call the same method in the
WindowListener.windowClosing()
hook,…

jumar
- 5,360
- 8
- 46
- 42
0
votes
1 answer
How to get rid of log4j message warning about "no appenders" at multi-thread application shutdown?
I have a multi-thread program which basically has two infinite loop threads plus some GUI (Swing). My two infinite loop threads have their own log4j loggers like this:
static final Category LOG = Category.getInstance(RReceiver.class);
When in…

tutejszy
- 602
- 7
- 22
0
votes
2 answers
Can a shutdown hook rely on another thread?
In a shutdown hook method, I need it to send a message to another process to say it has shutdown. My current message handling code requires that the message be written into a queue, this queue is processed by another thread and sent on to wherever…

A Jackson
- 2,776
- 7
- 34
- 45
0
votes
1 answer
Fake exit on a console application without closing it
Good morning.
This is a weird question, I know, but be patient with me, please! :-)
Scenario
Years ago I made a simple C# console application (call it MyApp, myapp.exe) that does some work for a big COBOL application (call it CblApp).
This app…

Ferdinando Santacroce
- 1,047
- 3
- 12
- 31
0
votes
1 answer
Java static TimerTask shutdown
I have a static, periodic, java Timer/TimerTask that I would like to shutdown when the app does. I don't want the app hanging because some thread is still running (like what happens in debug mode in eclipse, some environments may kill the thing…

Ryan R.
- 2,478
- 5
- 27
- 48