All of lore.kernel.org
 help / color / mirror / Atom feed
* Process exit codes
@ 2013-02-01 13:17 Grzegorz Dwornicki
  2013-02-04 16:17 ` Valdis.Kletnieks at vt.edu
  0 siblings, 1 reply; 9+ messages in thread
From: Grzegorz Dwornicki @ 2013-02-01 13:17 UTC (permalink / raw)
  To: kernelnewbies

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130201/35d6e419/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-01 13:17 Process exit codes Grzegorz Dwornicki
@ 2013-02-04 16:17 ` Valdis.Kletnieks at vt.edu
  2013-02-05 13:07   ` Grzegorz Dwornicki
  0 siblings, 1 reply; 9+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-02-04 16:17 UTC (permalink / raw)
  To: kernelnewbies

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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130204/14d1dda8/attachment.bin 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-04 16:17 ` Valdis.Kletnieks at vt.edu
@ 2013-02-05 13:07   ` Grzegorz Dwornicki
  2013-02-05 17:11     ` Valdis.Kletnieks at vt.edu
  2013-02-06  1:28     ` Mulyadi Santosa
  0 siblings, 2 replies; 9+ messages in thread
From: Grzegorz Dwornicki @ 2013-02-05 13:07 UTC (permalink / raw)
  To: kernelnewbies

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...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130205/41bc5b36/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-05 13:07   ` Grzegorz Dwornicki
@ 2013-02-05 17:11     ` Valdis.Kletnieks at vt.edu
  2013-02-05 18:47       ` Grzegorz Dwornicki
  2013-02-06  1:28     ` Mulyadi Santosa
  1 sibling, 1 reply; 9+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-02-05 17:11 UTC (permalink / raw)
  To: kernelnewbies

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130205/9b91b41f/attachment.bin 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-05 17:11     ` Valdis.Kletnieks at vt.edu
@ 2013-02-05 18:47       ` Grzegorz Dwornicki
  0 siblings, 0 replies; 9+ messages in thread
From: Grzegorz Dwornicki @ 2013-02-05 18:47 UTC (permalink / raw)
  To: kernelnewbies

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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130205/5e3d029e/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-05 13:07   ` Grzegorz Dwornicki
  2013-02-05 17:11     ` Valdis.Kletnieks at vt.edu
@ 2013-02-06  1:28     ` Mulyadi Santosa
  1 sibling, 0 replies; 9+ messages in thread
From: Mulyadi Santosa @ 2013-02-06  1:28 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-01 19:51 ` Grzegorz Dwornicki
@ 2013-02-02 16:58   ` Jimmy Pan
  0 siblings, 0 replies; 9+ messages in thread
From: Jimmy Pan @ 2013-02-02 16:58 UTC (permalink / raw)
  To: kernelnewbies

It's not a system call, because you can't use system call in modules.
I thought it's possible to fulfill your idea, you should better study
the code of __exit(), to find out what the kernel do, you can do it
manually, I thought you can modify the running state of the task,
maybe the kernel would do the remaining work for you.


On Sat, Feb 2, 2013 at 3:51 AM, Grzegorz Dwornicki <gd1100@gmail.com> wrote:
>
> Using syscall would be beter way I know. I was thinking what will happen if I change exit code of a process or/and process state. Will not this work similar? If soo then this is maybe faster method?
>
> G.
>
> 1 lut 2013 18:57, "dspjmt at gmail.com" <dspjmt@gmail.com> napisa?(a):
>
>>
>> i thought you just need to  send  a signal to it by a kernel function
>>
>> Sent from my HTC
>>
>> ----- Reply message -----
>> From: "Grzegorz Dwornicki" <gd1100@gmail.com>
>> To: <kernelnewbies@kernelnewbies.org>
>> Subject: Process exit codes
>> Date: Fri, Feb 1, 2013 9:17 pm
>>
>>
>> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Process exit codes
  2013-02-01 17:57 dspjmt
@ 2013-02-01 19:51 ` Grzegorz Dwornicki
  2013-02-02 16:58   ` Jimmy Pan
  0 siblings, 1 reply; 9+ messages in thread
From: Grzegorz Dwornicki @ 2013-02-01 19:51 UTC (permalink / raw)
  To: kernelnewbies

Using syscall would be beter way I know. I was thinking what will happen if
I change exit code of a process or/and process state. Will not this work
similar? If soo then this is maybe faster method?

G.
1 lut 2013 18:57, "dspjmt at gmail.com" <dspjmt@gmail.com> napisa?(a):

>
> i thought you just need to  send  a signal to it by a kernel function
>
> Sent from my HTC
>
> ----- Reply message -----
> From: "Grzegorz Dwornicki" <gd1100@gmail.com>
> To: <kernelnewbies@kernelnewbies.org>
> Subject: Process exit codes
> Date: Fri, Feb 1, 2013 9:17 pm
>
>
> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130201/ce98d7e5/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Process exit codes
@ 2013-02-01 17:57 dspjmt
  2013-02-01 19:51 ` Grzegorz Dwornicki
  0 siblings, 1 reply; 9+ messages in thread
From: dspjmt @ 2013-02-01 17:57 UTC (permalink / raw)
  To: kernelnewbies


 i thought you just need to  send  a signal to it by a kernel function
 
Sent from my HTC

----- Reply message -----
From: "Grzegorz Dwornicki" <gd1100@gmail.com>
To: <kernelnewbies@kernelnewbies.org>
Subject: Process exit codes
Date: Fri, Feb 1, 2013 9:17 pm
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130202/38343b3f/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-02-06  1:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-01 13:17 Process exit codes Grzegorz Dwornicki
2013-02-04 16:17 ` Valdis.Kletnieks at vt.edu
2013-02-05 13:07   ` Grzegorz Dwornicki
2013-02-05 17:11     ` Valdis.Kletnieks at vt.edu
2013-02-05 18:47       ` Grzegorz Dwornicki
2013-02-06  1:28     ` Mulyadi Santosa
2013-02-01 17:57 dspjmt
2013-02-01 19:51 ` Grzegorz Dwornicki
2013-02-02 16:58   ` Jimmy Pan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.