simple-init

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

commit fc53d6c44e3b4dd70fb55ae75147f52b633f558e
parent 4afc24fd19c1e7160bf8a41e40386f98d85e72ca
Author: depsterr <depsterr@protonmail.com>
Date:   Sun, 31 May 2020 18:42:46 +0200

added include for kill and fixed log calls

Diffstat:
Minitscripts/shutdown.c | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/initscripts/shutdown.c b/initscripts/shutdown.c @@ -1,4 +1,5 @@ #include <sys/reboot.h> +#include <sys/types.h> #include <signal.h> #include <unistd.h> @@ -8,24 +9,24 @@ int main(int argc, char* argv[]) { if (argc < 2) exit(1); - log("Saving random seed"); + log_message("Saving random seed"); save_random_seed(); - log("Sending TERM signal to all processes"); + log_message("Sending TERM signal to all processes"); kill(-1, SIGTERM); sleep(2); - log("Sending KILL signal to all processes"); + log_message("Sending KILL signal to all processes"); kill(-1, SIGKILL); - log("Unmounting all filesystems"); + log_message("Unmounting all filesystems"); char* swapcmd[] = { "swapoff", "-a", 0}; char* umountcmd[] = { "umount", "-ra", 0}; spawn_process(swapcmd); spawn_process(umountcmd); wait_for_children(); - log("Requesting shutdown from kernel"); + log_message("Requesting shutdown from kernel"); if(argv[1][0] == 'p') { reboot(RB_POWER_OFF); } else {