diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-08 13:03:45 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-08 13:03:45 +0900 |
| commit | e14923ae530dda0601c204fe17ac1956f54a45b0 (patch) | |
| tree | 1578bbc4c08d9afc94c4b009cd2bf64260574f05 /internal/priv/init/early.go | |
| parent | 7aff3ead3afaa7461e0054fbef23fb571b4add0a (diff) | |
helper/proc: move package out of internal
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/priv/init/early.go')
| -rw-r--r-- | internal/priv/init/early.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/priv/init/early.go b/internal/priv/init/early.go new file mode 100644 index 00000000..cc1c2f7e --- /dev/null +++ b/internal/priv/init/early.go @@ -0,0 +1,18 @@ +package init0 + +import ( + "os" + "path" + + "git.gensokyo.uk/security/fortify/internal/fmsg" +) + +// used by the parent process + +// TryArgv0 calls [Main] if argv0 indicates the process is started from a file named "init". +func TryArgv0() { + if len(os.Args) > 0 && path.Base(os.Args[0]) == "init" { + Main() + fmsg.Exit(0) + } +} |
