In my app  I am having a continuous communication with TCP server , now if   server sends a command to close the app, i want to close the app completely   and when user taps the app again, it should start with Application launch method itself.   I have tried using exit(0) in the code, using this application goes into background.But it doesn't kill the app. How can i do that?
30519
I am programming an iPhone app, and I need to force it to exit due to certain user actions.  After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application?
34264
I'm using tomcat, and sometimes when I tell it to stop it doesn't properly kill the process.  My way around this is too do:  lsof -i tcp:8080   which outputs:  COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME java    888 root   35u  IPv6 780659      0t0  TCP *:http-alt (LISTEN) java    888 root   39r  IPv6 790103      0t0  TCP localhost:58916-&gt;localhost:http-alt (CLOSE_WAIT) java    888 root   40r  IPv6 792585      0t0  TCP localhost:58936-&gt;localhost:http-alt (CLOSE_WAIT) java    888 root   75r  IPv6 785553      0t0  TCP localhost:58701-&gt;localhost:http-alt (CLOSE_WAIT) java    888 root   77r  IPv6 787642      0t0  TCP localhost:58814-&gt;localhost:http-alt (CLOSE_WAIT) java    888 root  130u  IPv6 783894      0t0  TCP localhost:58686-&gt;localhost:http-alt (CLOSE_WAIT) java    888 root  353u  IPv6 780929      0t0  TCP localhost:58632-&gt;localhost:http-alt (CLOSE_WAIT)   I then run   kill -9 pid   I want a way to get all the pid numbers and kill them.  Thing is I don't know how to isolate that field.
36650
Has anyone else noticed that Chrome refuses to quit instantly when using CmdQ?  Happens with one or several tabs open...  All the other apps I run can be ended by typing / tapping briefly CmdQ, but Chrome insists that I have to hold for an appreciable period of time.  This is becoming annoying, any ideas?
15688
Mac OS X doesn't recognize rfkill from its terminal, and I am looking for an alternative command that has similar functionality (toggling "Airplane Mode").  NOTE: I don't wish to open an .app to toggle. I'd like to execute the command from command line or within script in Bash (or equivalents).    By "Airplane Mode", I meant to borrow the term from iOS support page . I would like to disable all incoming/outgoing network communications from my system.
18169
I'm trying to run a minecraft server on my unRAID server.  The server will run in the shell, and then sit there waiting for input. To stop it, I need to type 'stop' and press enter, and then it'll save the world and gracefully exit, and I'm back in the shell. That all works if I run it via telnetting into the NAS box, but I want to run it directly on the box.   this is what I previously had as a first attempt:  #define USER_SCRIPT_LABEL Start Minecraft server #define USER_SCRIPT_DESCR Start minecraft server. needs sde2 mounted first cd /mnt/disk/sde2/MCunraid screen -d -m -S minecraft /usr/lib/java/bin/java -Xincgc -Xmx1024M -jar CraftBukkit.jar   MCunraid is the folder where I have the Craftbukkit.jar and all the world files etc. If I type that screen line in directly, the screen does setup detached and the server launches. If I execute that line from within the script it doesn't seem to set up a screen  for stopping the server, I need to 'type' in STOP and then press enter. My approach was  screen -S minecraft -X stuff "stop $(echo -ne '\r')"   to send to screen 'minecraft' the text s-t-o-p and a carriage return. But that doesn't work, even if I type it directly onto the command line. But if I 'screen -r' I can get to the screen with the server running, then type 'stop' and it shuts down properly.  The server runs well if I telnet in and do it manually, just need to run it without being connected from my remote computer.
7405
appstreamcli is overheating my laptop by constantly using 100% of a core. My only solution is to kill it. Here's a screenshot of :    I can kill appstreamcli with either sudo kill pid or sudo killall appstreamcli. But once I do sudo apt update, the appstreamcli process returns again and hangs the update. If I then kill it, I get the following output:  Reading package lists... Done E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli;  then appstreamcli refresh &gt; /dev/null;  fi' E: Sub-process returned an error code   What is this process and why is it using so much CPU?
85598
When I start a program from a terminal I can't use that terminal instance again until I close the program.  Is there a way to execute a program/application from a terminal without blocking the terminal until the program ends?
89423
When I start an SSH session that executes a long-running command, what happens with Ctrl+C (SIGINT) handling? I can see that the SSH session is closed, but I am not sure who gets the SIGINT first: is it...  the remote long-running command? that is, (a) the signal handler in the remote command is called and stops the remote command, (b) the shell that spawned it detects that the command stopped, and stops as well (c) the remote sshd detects the shell stopped, so it closes the connection or  the local ssh receives the signal, and closes the connection.   I think that (1) is happening, but want to make sure. I am also uncertain about what happens with shell handling of SIGINTs in this case. For example, if I ... ssh remote 'while true ; do sleep 1 ; date ; done'  and Ctrl+C, then the remote connection is dropped. Is there a way to run the remote command under a shell that will stay alive after Ctrl+C? That is, in this case, stop the loop and allow me to keep working on the remote shell?
49563
Every time I connect my iPhone to my MacBook, the system launches iTunes which I don't use. After I close it, the icon remains in the Dock and I have to right click and remove it. I don't move the icon in the Dock and I don't touch the Dock at all in this process.  Note that I am very aware that applications may be on the dock unless they are fully closed. In this case, not only is the app closed but the Activity Monitor does not list the process running.  Staying in the Dock also happens with other applications after I start them, but not all applications. Skype opened itself on reboot and after closing that application, it remained in the Dock. I also verified it is not listed in Activity Monitor. I removed the option to launch Skype on start and that one won't spin up each time, thankfully. But if I launch Skype manually it has the same behavior, it will place itself persistently into the Dock after it is closed.  How does an application put itself in the Dock? Is there a way to turn that off? Is it a setting?
46363
What is the proper way to terminate a Swing application from the code, and what are the pitfalls?  I'd tried to close my application automatically after a timer fires. But just calling dispose() on the JFrame didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do?
5501
I used to close a running application by pressing ALT+F4. But, I realised that the application is still running and the correct way to close (quit) it is the combination of Ctrl+Q keys.  So, what is the purpose of ALT+F4 and how is it different from Ctrl+Q?
26634
When my phone starts up there are several application/services running in the background that I would rather not.  And when I press the Home button while using an app, that app usually goes into the background without exiting.  How can I stop these apps from running?
37207
Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created).  In C#, I use Mutex class for this but I don't know how to do this in Java.
93630
Suppose I have a process which spawns exactly one child process. Now when the parent process exits for whatever reason (normally or abnormally, by kill, ^C, assert failure or anything else) I want the child process to die. How to do that correctly?    Some similar question on stackoverflow:   (asked earlier)  (asked later)      Some similar question on stackoverflow for Windows:
112312
How do I create a windows application that does the following:   it's a regular GUI app when invoked with no command line arguments specifying the optional "--help" command line argument causes the app to write usage text to stdout then terminate it must be a single executable.  No cheating by making a console app exec a 2nd executable. assume the main application code is written in C/C++ bonus points if no GUI window is created when "--help" is specified.  (i.e., no flicker from a short-lived window)   In my experience the standard visual studio template for console app has no GUI capability, and the normal win32 template does not send its stdout to the parent cmd shell.
60241
What is the best way to close an ASPX page from the code-behind?    I have a button event handler that I want to close the page after the user has clicked an ASP.NET button on the page.  I have tried to programmatically add a JavaScript method that contains a window.close() command to the OnClientClick event to close the page but it does not work.  The button is also a asp:AsyncPostBoskTrigger for an AJAX Update Panel.  The application uses .NET Framework 3.5.
68609
I closed an application, but the process remained in the list. I try to stop in from the task manager, but nothing happens. No error messages, process just stays in the list. I try to debug it, but the debugger says:     Unable to attach to the crashing process. The requested operation is not supported.     This happens with VS2008 and some other programs, sometimes.  How to terminate it?