D
dwmyers
I have a task that runs as follows:
1) examine a daemon in memory for size usage. If it gets beyond a
certain size, kill it.
2) wait a while
3) restart the process.
I'm trying with a bit of code like this:
system("pkill -9 foo");
sleep 10;
system("/etc/init.d/foo start");
Only problem is, the sleep isn't working, and the process isn't
restarting. I tend to think the first system call must be returning
signals that kill the sleep, but I'm not deep enough into the internals
to know.
If you have any ideas, I'm interested.
David.
1) examine a daemon in memory for size usage. If it gets beyond a
certain size, kill it.
2) wait a while
3) restart the process.
I'm trying with a bit of code like this:
system("pkill -9 foo");
sleep 10;
system("/etc/init.d/foo start");
Only problem is, the sleep isn't working, and the process isn't
restarting. I tend to think the first system call must be returning
signals that kill the sleep, but I'm not deep enough into the internals
to know.
If you have any ideas, I'm interested.
David.