Thursday, March 22, 2012

Patch linux kernel for add ability to send an event about do_fork()/do_exit()

Recently I have interesting question - how to create event about do_fork()/do_exit of group of processes, not any process but some of them. It's very useful, for example, when one want to create group of persistent processes (IDS/IPS), but sometimes software "fall" =) and system must restart it. So we can make cron script for checking PIDs, we can create N pthreads and then in each thread exec() new process, when wait4() it (when it falls re-exec it). The first solution lead in persistent scanning (each t-seconds we must to check even nothing happened), second solution no so scalable, bcoz we need 2N + 1 working processes for N persistent processes. Of course, it's not load system, each wait4() thread sleep and doesn't eat much cpu time. And I had create small kernel patch based on cgroups subsystem. Shortly, we push persistent processes to a special group and set userspace event handler. When process move out from this cgroup (when process do_exit() it's move out too) we catch event and restart this process.

Sunday, March 11, 2012

vacation

So, I have 5 mins for telling about our vacation. We was in Bulgaria ski place. It names Bansko

Saturday, March 10, 2012

questions from a M$ interview

Thx for my friend))) I think this questions from his interview for the Bing command.