diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-13 21:57:54 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-13 21:57:54 +0900 |
| commit | 4133b555ba8dd38accb272d86c01898ac4b99f95 (patch) | |
| tree | eb759ced154d8e35dd8ea85e4c58f027488ba793 /internal/app/init0/early.go | |
| parent | 9b1a60b5c9f7a92abb632639117d61c5cbaf74f7 (diff) | |
internal/app: rename init to init0
This makes way for the new container init.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/init0/early.go')
| -rw-r--r-- | internal/app/init0/early.go | 18 |
1 files changed, 18 insertions, 0 deletions
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) + } +} |
