#include
int main()
{
#define INIT "/sbin/init"
char *args[8];
args[0] = INIT;
args[1] = "0";
args[2] = (char *)NULL;
sync();
return execv(INIT, args);
}
luther@gliethttp:/vobs/tmp$ gcc shutdow_init.c
luther@gliethttp:/vobs/tmp$ sudo ./a.out
ps:以上思路源自sysvinit包中的shutdown.c
阅读(1001) | 评论(0) | 转发(0) |