Retourner au contenu associé (journal : Processus Init et "Kernel panic: Attempted to kill init")
Posté par Prae le 18 octobre 2002 à 00:39. En réponse au journal Processus Init et "Kernel panic: Attempted to kill init". Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# Re: Processus Init et
Posté par Prae . En réponse au journal Processus Init et "Kernel panic: Attempted to kill init". Évalué à 1.
--
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/reboot.h>
#include <sys/mount.h>
int main(void)
{
printf(" Bienvenue dans notre premier Init >\n");
printf("Arret Machine...4\n");
printf("== Envoi du signal de terminaison ==>\n");
kill(-1,SIGTERM);
printf("== Envoi du signal de tuerie ==>\n");
kill(-1, SIGKILL);
printf("== Montage en lecteur seule ==>\n");
if(mount("/dev/hda1", "/dev/hda1", 0, MS_MGC_VAL|MS_REMOUNT|MS_RDONLY, 0)==-1)
{
printf("error remounting \"%s\" readonly\n", "/dev/hda1");
}
printf("== Demontage - de force - de la partition root ==>\n");
if(umount2("/dev/hda1", MNT_FORCE) == -1)
{
printf("Demontage erroné\n");
}
sync();
printf("== Reboot Code ==>\n");
reboot(RB_HALT_SYSTEM);
return 1;
}
---
voila :)