]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
lib/ukboot: Implement /sbin/init logic
authorMichalis Pappas <michalis@unikraft.io>
Mon, 7 Apr 2025 16:35:28 +0000 (18:35 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Wed, 30 Apr 2025 10:07:29 +0000 (10:07 +0000)
commit65d6cc10c91e004475261f90e0bf7232feeff559
tree77a579e7427c722481a3a771bb30c732f6cd920e
parentc291279d1e708e78efb5be2ada27197f6402a62b
lib/ukboot: Implement /sbin/init logic

Add /sbin/init logic for multiprocess configurations. This is controlled
by a new option, CONFIG_LIBUKBOOT_INIT. The init logic is implemented as
part of PID 1, and spawns the application into a new process. Besides
fostering reparented orphans, and reaping children, it also manages
system shutdown and returning the application's exit status back to
ukboot.

A second option, namely CONFIG_LIBUKBOOT_GRACEFUL_SHUTDOWN, provides the
ability to signal children with a configurable signal, and block until
they exit until a configurable timeout. If the timeout is reached and
children are still alive, init returns and libposix-process forcefully
terminates all remaining processes.

Checkpatch-Ignore: AVOID_EXTERNS
Checkpatch-Ignore: LONG_LINE;
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1633
lib/ukboot/Config.uk
lib/ukboot/Makefile.uk
lib/ukboot/boot.c
lib/ukboot/init.c [new file with mode: 0644]
lib/ukboot/init.h [new file with mode: 0644]