由买买提看人间百态

topics

全部话题 - 话题: sigkill
(共0页)
A********l
发帖数: 184
1
来自主题: JobHunting版 - Unix高手来看看GS的UNIX题
How might one trap a SIGKILL from within shell, or C, Perl or
Python?
印象中SIGKILL signal是无法trap的,求高手解答。

without
will
c*********n
发帖数: 182
2
来自主题: JobHunting版 - Unix高手来看看GS的UNIX题
• How many ways can you think of to remove a file called '-r'?
unlink/rm/...?
• How might one trap a SIGKILL from within shell, or C, Perl or
Python?
Perhaps there are nothing you can do with SIGKILL without patching the init.
..
• Can a Unix process become unkillable? If so, how?
Yes. uninterruptible sleep
• How would you find the disk space consumed by a directory without
using du?
don't know. find . | ls | awk | sort | awk | ... ?! &*^(&@#(*^@#
• W... 阅读全帖
Z****e
发帖数: 2999
3
来自主题: Java版 - java & signal process
"Two signals are unable to be redefined by a signal handler. SIGKILL always
stops a process and SIGSTOP always moves a process from the foreground to
the background. These two signals cannot be "caught" by a signal handler."
so there you go, unix process cannot trap SIGKIL
I think it's prossible to trap other signals by using sun.misc.Signal
P*****f
发帖数: 2272
4
来自主题: Programming版 - does the system guarantee this? (转载)
any reference for this behavior? especially in case of SIGKILL

what i meant is, whatever you do to the user space process, if the data is
already in kernel (e.g. in the file descriptor buffer), it will be sent out
no matter what happens, be it SIGKILL or SIGSEGV. all opened files will be
closed automatically.
about
c***2
发帖数: 838
5
来自主题: JobHunting版 - how to kill all child processes of a process
send a "kill" signal to all of them?
SIGTERM or SIGKILL
k***t
发帖数: 276
6
来自主题: JobHunting版 - Twitter实习第一轮电面总结
第一个,为何不直接写递推或cached/DP的代码?
第二个,assume a heap was used to do N-way merge。
第三个,准确的讲,kill cmd is used to send signal. By default, SIGTERM is
sent. 9 is SIGKILL, 7 is SIGBUS.

1)
s********k
发帖数: 6180
7
来自主题: JobHunting版 - Unix高手来看看GS的UNIX题
Unix Questions (shell questions apply to sh/ksh/bash)
• How many ways can you think of to remove a file called '-r'?
• How might one trap a SIGKILL from within shell, or C, Perl or
Python?
• Can a Unix process become unkillable? If so, how?
• How would you find the disk space consumed by a directory without
using du?
• What happens if /dev/zero is deleted from a running system? If
you want it back, how do you recover it?
• When using a termin... 阅读全帖
j****l
发帖数: 85
8
来自主题: JobHunting版 - Yelp电面小问题汇总
之前好像有人整理过了,但是找不到了,我综合了几个地方的整理了一下,贡献给大家
啦。感谢原作者。
Why Yelp?
Why would we hire you?
Ideal job at Yelp?
NETWORK
What is DNS?
protocol used to transfer message in HTTP application? TCP reliable
What is SSL?
Port number for HTTP? 80
What does HTML stand for?
What is the protocol used underneath FTP?
Difference between POST and GET?
UNIX
UNIX command to search for a specific text through files in a directory.
Find number of unique lines in a file.
signal for kill command? 9, SIGKILL
What is the comma... 阅读全帖
P*****f
发帖数: 2272
9
来自主题: Programming版 - does the system guarantee this? (转载)
I think no way to guarantee that unless you write your know kernel patch.
In userspace you cannot get chance to handle SIGKILL or SIGSTOP signal for
example.

【 以下文字转载自 Linux 讨论区 】
发信人: crystalike (New Start), 信区: Linux
标 题: does the system guarantee this?
发信站: BBS 未名空间站 (Wed Oct 24 20:50:25 2007)
in c++ using std::endl or iostream.flush will flush the buffer in the user
space. does this also flush the kernel buffer?
we know that when exit () is called, buffers will be flushed but what about
th
t****t
发帖数: 6806
10
来自主题: Programming版 - does the system guarantee this? (转载)
what i meant is, whatever you do to the user space process, if the data is
already in kernel (e.g. in the file descriptor buffer), it will be sent out
no matter what happens, be it SIGKILL or SIGSEGV. all opened files will be
closed automatically.

about
t**********g
发帖数: 3388
11
【 以下文字转载自 Linux 讨论区 】
发信人: thanksgiving (~灯红酒绿的上海~), 信区: Linux
标 题: 如果一个程序被另一个进程kill,有没有办法知道那个进程是什么?
发信站: BBS 未名空间站 (Mon Jul 28 14:35:19 2008)
Linux里,如果一个程序被另一个后台进程SIGKILL,但是不清楚那个进程是什么,有没
有办法查出来?
f**y
发帖数: 138
12
you can get the process id and uid of the sender of SIGINT or SIGTERM from
siginfo_t structure sent to sigaction handler.Not for SIGKILL or SIGSTOP,
which can not be caught.
t****t
发帖数: 6806
13
来自主题: Programming版 - java & signal process
you can never trap signal 9 (SIGKILL), even without java.
neither can you trap SIGSTOP.
l***t
发帖数: 114
14
来自主题: Unix版 - kill init process
If you(root) send init the SIGKILL, init will not die. Why?
Where is the source code in freebsd4.2?
Thanks.
y*****p
发帖数: 733
15

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I experienced the same problem!! And the pthread_kill just terminated
the program when I send SIGTERM. if I use SIGKILL, pthread_kill kill.
The other thing I hate is that it doesn't give you any error!
I switch to pthread_cancel. It's said it's not a good way to use.
But at lease it seems to work for my hw.
n***l
发帖数: 9
16
来自主题: Unix版 - FreeBSD: Can't kill child process!
我有下面简单的code
pid = fork();
if (pid == 0) {
printf("Child process running\n");
} else if (pid < 0) {
printf("Failed on fork()\n");
exit(0);
} else {
... ...
if (kill(pid, SIGKILL) < 0) {
perror("Failed on kill()");
}
while(1){ ... ... };
}
运行后发现kill失败了。比如Child process的PID是4726,
在命令行“ps 4726”,结果是空的。但是用“ps”可以看到
child process。在命令行用“kill -9 4726”,系统报
错:No such process。
谁知道这到底是怎么会事?Thanks.
(共0页)