X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=state.c;fp=state.c;h=b9416341440d873b999dadbda8e6b43a0b9a3477;hp=bba59665167df085bda91337dadb447332b4376d;hb=98975d54d405c45edf7bab2205d6ffb75ed90438;hpb=396a82c551ab02871ec0e6f399941c9379258bdc diff --git a/state.c b/state.c index bba5966..b941634 100644 --- a/state.c +++ b/state.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include "procd.h" #include "syslog.h" @@ -75,6 +77,14 @@ static void state_enter(void) break; case STATE_HALT: + LOG("- SIGTERM processes -\n"); + kill(-1, SIGTERM); + sync(); + sleep(1); + LOG("- SIGKILL processes -\n"); + kill(-1, SIGKILL); + sync(); + sleep(1); LOG("- reboot -\n"); reboot(reboot_event); break;