simple-init

A set of init binaries for linux
git clone git://depsterr.com/git/simple-init
Log | Files | Refs | README | LICENSE

commit 80567e8d01fd1d2218ab30453a03170a615cfca5
parent 1bc3909d5da0c539769e2b427b92ebc848480034
Author: depsterr <depsterr@protonmail.com>
Date:   Sun, 31 May 2020 18:58:04 +0200

added kill back to shutdown

Diffstat:
Minitscripts/shutdown.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/initscripts/shutdown.c b/initscripts/shutdown.c @@ -15,12 +15,24 @@ int main(int argc, char* argv[]) { log_message("Syncing"); sync(); + log_message("Sending TERM signal to all processes"); + kill(-1, SIGSTOP) + kill(-1, SIGTERM) + kill(-1, SIGCONT) + sleep(2); + + log_message("Sending KILL signal to all processes"); + kill(-1, SIGSTOP) + kill(-1, SIGKILL) + kill(-1, SIGCONT) + log_message("Unmounting all filesystems"); char* swapcmd[] = { "swapoff", "-a", 0}; char* umountcmd[] = { "umount", "-ra", 0}; spawn_process(swapcmd); spawn_process(umountcmd); - wait_for_children(); + /* wait for children without caring about failing */ + while(wait(0) > 0); log_message("Requesting shutdown from kernel"); if(argv[1][0] == 'p') {