kill

Prevent Activity Stack from being Restored?

拈花ヽ惹草 提交于 2019-11-27 12:05:39
When an application's process is killed, its activity stack is saved. Then when the application is restarted, all my activities resume and run into null pointers. Rather than modify every activity to accommodate this event, I would rather just have my application start with the base activity and not try to re-create the activity stack. Is this possible? I know about Intent.FLAG_ACTIVITY_CLEAR_TOP, but as I understand that will only kill activities after they have been re-created. EDIT: is clearTaskOnLaunch what I want? I've added it to my default activity, but am seeing no effect. But this

Terminating idle mysql connections

孤者浪人 提交于 2019-11-27 11:33:49
I see a lot of connections are open and remain idle for a long time, say 5 minutes. Is there any solution to terminate / close it from server without restarting the mysql service? I am maintaining a legacy PHP system and can not close the connections those are established to execute the query. Should I reduce the timeout values in my.cnf file those defaults to 8 hours? # default 28800 seconds interactive_timeout=60 wait_timeout=60 Manual cleanup: You can KILL the processid. mysql> show full processlist; +---------+------------+-------------------+------+---------+-------+-------+--------------

Ensuring subprocesses are dead on exiting Python program

只愿长相守 提交于 2019-11-27 11:11:36
Is there a way to ensure all created subprocess are dead at exit time of a Python program? By subprocess I mean those created with subprocess.Popen(). If not, should I iterate over all of the issuing kills and then kills -9? anything cleaner? You can use atexit for this, and register any clean up tasks to be run when your program exits. atexit.register(func[, *args[, **kargs]]) In your cleanup process, you can also implement your own wait, and kill it when a your desired timeout occurs. >>> import atexit >>> import sys >>> import time >>> >>> >>> >>> def cleanup(): ... timeout_sec = 5 ... for

How can I prevent my Android app/service from being “killed” from a task manager?

主宰稳场 提交于 2019-11-27 10:56:44
问题 It is very important that my service stay running until someone with a password stops the service from my UI screen. My app runs great but it is designed to be turned on/off by parents (with a password) on their kids phones. I have managed to make everything work but the problem I'm having is that if the kid uses a task manager to kill my service then my app is useless. I would be grateful to anyone who knows a way to either 1) monitor the service and start it back up automatically if its

linux: kill background task

孤人 提交于 2019-11-27 10:01:58
How do I kill the last spawned background task in linux? Example: doSomething doAnotherThing doB & doC doD #kill doB ???? There's a special variable for this in bash: kill $! $! expands to the PID of the last process executed in the background. You can kill by job number. When you put a task in the background you'll see something like: $ ./script & [1] 35341 That [1] is the job number and can be referenced like: $ kill %1 $ kill %% # Most recent background job To see a list of job numbers use the jobs command. More from man bash : There are a number of ways to refer to a job in the shell. The

How can I kill all sessions connecting to my oracle database?

柔情痞子 提交于 2019-11-27 09:51:50
问题 I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator. I don't want to just lock the database and let the users quit gracefully. How would I script this? 回答1: This answer is heavily influenced by a conversation here: http://www.tek-tips.com/viewthread.cfm?qid=1395151&page=3 ALTER SYSTEM ENABLE RESTRICTED SESSION; begin for x in ( select Sid, Serial#, machine, program from v$session where machine <>

Starting apache fails (could not bind to address 0.0.0.0:80)

不羁的心 提交于 2019-11-27 09:10:20
问题 Update: Already fixed, it seems that one of VirtualHosts configurations files was wrong in sites-enabled. I have Ubuntu 11.10 When I run the command to start apache2: sudo /etc/init.d/apache2 start I get the following error message: Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down

Kill detached screen session [closed]

↘锁芯ラ 提交于 2019-11-27 08:54:17
问题 I learned from somewhere a detached screen can be killed by screen -X -S [session # you want to kill] kill where [session # you want to kill] can be gotten from screen -ls But this doesn't work. Anything wrong? What's the correct way? 回答1: "kill" will only kill one screen window. To "kill" the complete session, use quit . Example $ screen -X -S [session # you want to kill] quit For dead sessions use: $ screen -wipe 回答2: You can kill a detached session which is not responding within the screen

Detect when console application is closing/killed?

烈酒焚心 提交于 2019-11-27 07:34:31
问题 I wanted to make a safe exit for my console application that will be running on linux using mono but I can't find a solution to detect wether a signal was sent to it or the user pressed ctrl+c. On windows there is the kernel function SetConsoleCtrlHandler which does the job but that doesnt work on mono. How do I get a closing event on my console application to safe exit it ? 回答1: You need to use Mono.UnixSignal , there's a good sample posted by Jonathan Pryor : http://www.jprl.com/Blog

What does 'killed' mean?

我的未来我决定 提交于 2019-11-27 07:10:13
I have a Python script that imports a large CSV file and then counts the number of occurrences of each word in the file, then exports the counts to another CSV file. But what is happening is that once that counting part is finished and the exporting begins it says Killed in the terminial. I don't think this is a memory problem (if it was I assume I would be getting a memory error and not Killed ). Could it be that the process is taking too long? If so, is there a way to extend the time-out period so I can avoid this? Here is the code: csv.field_size_limit(sys.maxsize) counter={} with open("