Procd as it currently is does not kill the running processes during shutdown.
As this might cause undesired behaviour, this should be implemented.
Implementation was taken from busybox 1.19.4
Signed-off-by: Michel Stam <m.stam@fugro.nl>
#include <sys/reboot.h>
#include <stdlib.h>
#include <unistd.h>
+#include <sys/types.h>
+#include <signal.h>
#include "procd.h"
#include "syslog.h"
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;