Hi Can I kill process by changing its exit codes in task_struct structure? Lets do this in 2 steps: 1. Modify the exit codes in task_struct 2. Call schedule I want to do something like kill -9 on specyfic process using kernel module Thanks G.
On Fri, 01 Feb 2013 14:17:18 +0100, Grzegorz Dwornicki said:
I want to do something like kill -9 on specyfic process using kernel module
Let's take a step back - can you explain *why* you're trying to do a kill -9 from a kernel module? There's a really good chance that there's already a better API for what you're trying to do, depending on what and why your actual goal is...
I guess that there may be a better API that why this thread was created in first place. My project goal is to make process checkpoints like cryopid had. This is for my thesis and will be GPL for everyone after my graduaction. I am researching this subject at this point. 4 lut 2013 17:18, <Valdis.Kletnieks@vt.edu> napisał(a):
On Fri, 01 Feb 2013 14:17:18 +0100, Grzegorz Dwornicki said:
I want to do something like kill -9 on specyfic process using kernel module
Let's take a step back - can you explain *why* you're trying to do a kill -9 from a kernel module? There's a really good chance that there's already a better API for what you're trying to do, depending on what and why your actual goal is...
On Tue, 05 Feb 2013 14:07:37 +0100, Grzegorz Dwornicki said:
I guess that there may be a better API that why this thread was created in first place. My project goal is to make process checkpoints like cryopid had. This is for my thesis and will be GPL for everyone after my graduaction. I am researching this subject at this point.
In that case, you want to go look at the checkpoint/restart patches that are already in the kernel, and in process. Hint - it's a *lot* harder to do this right than a thesis project (unless you want to only do a very restricted subset, like "no open files", "no TCP connections", etc). In fact, a lot of the 'namespace' stuff was added to help support C/R. For instance, the PID namespace is there to deal with the fact that if you checkpoint a process with PID 23974, you need to be able to guarantee that it gets 23974 on restart (as otherwise you hit problems with getpid() and kill() not referring to the process you though it did). Of course, this majorly sucks if that PID is already in use. The solution there is to spawn a new, empty PID namespace to guarantee that number is available... https://ckpt.wiki.kernel.org/index.php/Main_Page is a good place to start.
Thx for the tips :) 5 lut 2013 18:12, <Valdis.Kletnieks@vt.edu> napisał(a):
On Tue, 05 Feb 2013 14:07:37 +0100, Grzegorz Dwornicki said:
I guess that there may be a better API that why this thread was created in first place. My project goal is to make process checkpoints like cryopid had. This is for my thesis and will be GPL for everyone after my graduaction. I am researching this subject at this point.
In that case, you want to go look at the checkpoint/restart patches that are already in the kernel, and in process. Hint - it's a *lot* harder to do this right than a thesis project (unless you want to only do a very restricted subset, like "no open files", "no TCP connections", etc). In fact, a lot of the 'namespace' stuff was added to help support C/R. For instance, the PID namespace is there to deal with the fact that if you checkpoint a process with PID 23974, you need to be able to guarantee that it gets 23974 on restart (as otherwise you hit problems with getpid() and kill() not referring to the process you though it did). Of course, this majorly sucks if that PID is already in use. The solution there is to spawn a new, empty PID namespace to guarantee that number is available...
https://ckpt.wiki.kernel.org/index.php/Main_Page is a good place to start.
On Tue, Feb 5, 2013 at 8:07 PM, Grzegorz Dwornicki <gd1100@gmail.com> wrote:
I guess that there may be a better API that why this thread was created in first place. My project goal is to make process checkpoints like cryopid had. This is for my thesis and will be GPL for everyone after my graduaction. I am researching this subject at this point.
Please don't top post :) Google for CRIU project..maybe you better participate there and improve it on some parts. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (3)
-
Grzegorz Dwornicki -
Mulyadi Santosa -
Valdis.Kletnieks@vt.edu