kill

Kill rosbag gracefully via kill

一曲冷凌霜 提交于 2019-12-10 06:33:11
问题 I'd like to kill a rosbag instance gracefully via terminal. Gracefully means in that case, that the rosbag file doesn't have the suffix .active after kill. so I do the following from terminal to send the recommended SIGINT to rosbag: $ rosbag record /some/topic & $ RPID=$! $ # do some stuff $ kill -2 $RPID Unfortunately, the bag remains active and it can happen that not everything was stored to the disk. However, if I put rosbag into a launch file, it seems to work: $ roslaunch rosbag_record

How can one send a Ctrl-Break to a running Linux process?

試著忘記壹切 提交于 2019-12-10 02:00:24
问题 I am debugging a memory leak in an application running on Sun's JDK 1.4.2_18. It appears that this version supports the command line param -XX:+HeapDumpOnCtrlBreak which supposedly causes the JVM to dump heap when it encounters a control-break. How does one send this to a background process on a Linux box? It appears that kill signals are the way this ought to work, but I kill -l doesn't report anything that is obviously a Ctrl-Break, at least on my Ubuntu box. Update: I tested Kill -3 with

Clean shutdown of a Python script

旧街凉风 提交于 2019-12-09 19:45:17
问题 I have a threaded server written in Python that I start using the following shell script: #!/bin/bash base_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" public_dns=$(curl -s http://169.254.169.254/latest/meta-data/public-hostname) echo $public_dns > "$base_path/client/address" cd "$base_path/server" python "server.py" & echo $! > "$base_path/server_pid" echo "Server running" I echo the PID to a file so that I can shutdown a server using another shell script: #!/bin/bash base_path="

SQL: Interrupting a query

喜夏-厌秋 提交于 2019-12-09 16:50:05
问题 I've worked on a project using a proprietary non-SQL DB where queries could be interrupted and in the codebase there were quite some spots where that functionnality was used and made perfect sense (for example to stop a long running query that gets cancelled by the user, or when a more recent query takes place and renders the previous query obsolete, etc.) and I realized I never really saw that kind of "interrupted queries" previously and thought it could make a good SO question (several

How should I clean up hung grandchild processes when an alarm trips in Perl?

只愿长相守 提交于 2019-12-09 09:23:27
问题 I have a parallelized automation script which needs to call many other scripts, some of which hang because they (incorrectly) wait for standard input or wait around for various other things that aren't going to happen. That's not a big deal because I catch those with alarm. The trick is to shut down those hung grandchild processes when the child shuts down. I thought various incantations of SIGCHLD , waiting, and process groups could do the trick, but they all block and the grandchildren aren

How to kill process inside container? Docker top command

安稳与你 提交于 2019-12-09 04:15:38
问题 I have simple example from official guide at docker website. I run the following: sudo docker run -d ubuntu:latest /bin/sh -c "while true; do echo hello world; sleep 1; done" a66asdasdhqie123... Then take some output from created container: sudo docker logs a66 hello hello hello ... Then I lookup the running processes of a container: sudo docker top a66 UID PID PPID C STIME TTY TIME CMD root 25055 15152 0 20:07 ? 00:00:00 /bin/sh -c while true; do echo hello world; sleep 1; done root 25295

Kill process after a given time bash?

北战南征 提交于 2019-12-09 04:08:33
问题 I have a script that tries to make a DB connection using another program and the timeout(2.5min) of the program is to long. I want to add this functionality to the script. If it takes longer then 5 seconds to connect, kill the process Else kill the sleep/kill process. The issue I'm having is how bash reports when a process is killed, that's because the processes are in the same shell just the background. Is there a better way to do this or how can I silence the shell for the kill commands? DB

How can I kill a whole process tree with Perl?

纵然是瞬间 提交于 2019-12-08 19:39:53
问题 What's the best way to kill a process and all its child processes from a Perl script? It should run at least under Linux and Solaris, and not require installation of any additional packages. My guess would be to get a list of all processes and their parents by parsing files in /proc or by parsing the output of ps (neither of which seems portable between Linux and Solaris); and then killing all processes in the tree (which seems prone to race conditions). I could live with the race conditions

cannot kill redis-server on linux

折月煮酒 提交于 2019-12-08 12:38:41
问题 No matter what I do I can't seem to kill redis without another instance popping up immediately with a different PID -- I checked to make sure I was killing the parent process and I was. Any suggestions?? I've already tried restarting my machine. I've also tried the answers from this SO post. Here are the commands I ran to kill and check: ascourtas@ascourtas-VirtualBox:~$ ps -ef | grep redis redis 2573 1 0 12:11 ? 00:00:00 /usr/bin/redis-server 0.0.0.0:6379 ascourt+ 2991 2501 0 12:25 pts/6 00

BASH: Explain about kill command [closed]

☆樱花仙子☆ 提交于 2019-12-08 12:00:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I was looking for a solution about a silent kill command and I successfully found the solution here , in the forum , by the command: kill -9 "process_name" &> /dev/null but , my question is: What does " &> /dev/null " mean? Any tips and advice will be appreciated! Thank you 回答1: &>/dev/null redirects all of the