kill

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

末鹿安然 提交于 2019-11-28 17:58:04
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 "killed" or 2) prevent someone from being able to kill it except from the activity (administration screen)

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

走远了吗. 提交于 2019-11-28 16:42:52
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? BIBD 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 <> 'MyDatabaseServerName' ) loop execute immediate 'Alter System Kill Session '''|| x.Sid || ',' || x.Serial# ||

How to kill a nohup process?

醉酒当歌 提交于 2019-11-28 15:39:09
问题 I executed the following command $ nohup ./tests.run.pl 0 & now when I try to kill it (and the executions that are started from this script) using $ kill -0 <process_id> it does not work. How can I kill a nohupped process and the processes that runs via the nohupped script? Thanks 回答1: kill -0 does not kill the process. It just checks if you could send a signal to it. Simply kill pid , and if that doesn't work, try kill -9 pid . 回答2: Simply kill <pid> which will send a SIGTERM , which nohup

shell script to kill the process listening on port 3000? [duplicate]

人盡茶涼 提交于 2019-11-28 15:30:31
This question already has an answer here: How to kill a process running on particular port in Linux? 20 answers I want to define a bash alias named kill3000 to automate the following task: $ lsof -i:3000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ruby 13402 zero 4u IPv4 2847851 0t0 TCP *:3000 (LISTEN) $ kill -9 13402 alias kill3000="fuser -k -n tcp 3000" Try this: kill -9 $(lsof -i:3000 -t) The -t flag is what you want: it displays PID, and nothing else. UPDATE In case the process is not found and you don't want to see error message: kill -9 $(lsof -i:3000 -t) 2> /dev/null Assuming you

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

China☆狼群 提交于 2019-11-28 15:21:16
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 Unable to open logs Action 'start' failed. I run this command in order to get the process that is using

Kill detached screen session [closed]

∥☆過路亽.° 提交于 2019-11-28 14:53:49
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? innaM "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 Melvin Peter You can kill a detached session which is not responding within the screen session by doing the following. Type screen -list to identify the detached screen session. ~$

Android - Perfect solution for quitting or terminating an application programmatically?

▼魔方 西西 提交于 2019-11-28 14:12:03
问题 If my app encounters a particular error, I want to end my app without any trace of it remaining in the system. I have already seen many threads on this topic, specially these two. Is quitting an application frowned upon? How to quit android application programmatically The answers are great but the proposed solutions are too tedious and/or unnecessarily complex. 回答1: Taking a cue from Neil Traft's answer in the first post above, I have found a perfect solution for such scenarios. System.exit

Java - Process.destroy() source code for Linux

半腔热情 提交于 2019-11-28 13:20:18
I need to check to code of Process.destroy() to see how exactly it kill s a subprocess on Linux. Does anyone know what this method does or have a link to its source? I checked the jdk source and Process is just an abstract class and the destroy method has not been implemented, there seem to be no links to any subclass that extends or implements Process . Any help will be appreciated. Thanks, Daniel Kamil Kozar Process management and all the like operations are done by the OS. Therefore, the JVM has to call the appropriate system call in order to destroy a process. This will, obviously, vary

Detect when console application is closing/killed?

牧云@^-^@ 提交于 2019-11-28 13:16:28
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 ? You need to use Mono.UnixSignal , there's a good sample posted by Jonathan Pryor : http://www.jprl.com/Blog/archive/development/mono/2008/Feb-08.html There's also a shorter example on Mono page: FAQ / Technical / Operating

Handle force close?

瘦欲@ 提交于 2019-11-28 10:38:10
Is there a way to notify an activity/service of a force-close request right before it gets killed? I mean when the user hits the force close button in Menu > Settings > Applications > Manage applications > app name > Force Close . Charlie Collins I think the ActivityManager just kills the hosting process, so you may not be able to get any event/message/warning. To check you could create an app that has a single Activity that lets you know if onDestroy is called, and further if isFinishing is invoked. The path to Menu > Settings > Applications > Manage applications > app name > Force Close in