From 4133b555ba8dd38accb272d86c01898ac4b99f95 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 13 Mar 2025 21:57:54 +0900 Subject: internal/app: rename init to init0 This makes way for the new container init. Signed-off-by: Ophestra --- internal/app/init0/early.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 internal/app/init0/early.go (limited to 'internal/app/init0/early.go') diff --git a/internal/app/init0/early.go b/internal/app/init0/early.go new file mode 100644 index 00000000..0bcf094c --- /dev/null +++ b/internal/app/init0/early.go @@ -0,0 +1,18 @@ +package init0 + +import ( + "os" + "path" + + "git.gensokyo.uk/security/fortify/internal" +) + +// used by the parent process + +// TryArgv0 calls [Main] if the last element of argv0 is "init0". +func TryArgv0() { + if len(os.Args) > 0 && path.Base(os.Args[0]) == "init0" { + Main() + internal.Exit(0) + } +} -- cgit v1.3.1