Compare commits
2 commits
180881639b
...
543e1cdd14
Author | SHA1 | Date | |
---|---|---|---|
ptrcnull | 543e1cdd14 | ||
ptrcnull | 83a7661a7d |
|
@ -8,4 +8,3 @@ Drop-in replacement for busybox init (kind of)
|
||||||
|
|
||||||
- askfirst handling
|
- askfirst handling
|
||||||
- other devices than /dev/console
|
- other devices than /dev/console
|
||||||
- proper shutdown
|
|
||||||
|
|
6
main.go
6
main.go
|
@ -57,6 +57,12 @@ func main() {
|
||||||
|
|
||||||
signal.Notify(sigs, syscall.SIGUSR2, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGINT)
|
signal.Notify(sigs, syscall.SIGUSR2, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGINT)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
syscall.Wait4(-1, nil, 0, nil)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,8 @@ func Exec(entry InitTabEntry) error {
|
||||||
return fmt.Errorf("spawn: %w", err)
|
return fmt.Errorf("spawn: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = cmd.Wait()
|
// skipping error handling due to wait4 in main
|
||||||
if err != nil {
|
cmd.Wait()
|
||||||
return fmt.Errorf("wait: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue