AdGuardHome/internal/aghos/os_unix.go
Ainar Garipov fa49d74aa8 Pull request: upd-all
Merge in DNS/adguard-home from upd-all to master

Squashed commit of the following:

commit 8fe5f029f2092ff1b23c6b734fef35937658c6d3
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Dec 7 16:13:04 2022 +0300

    aghos: fix windows root dir

commit 57237df1d95c7c72cc02103eb869590a2b8fe50c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Dec 7 15:18:59 2022 +0300

    all: upd go, i18n, svcs
2022-12-07 16:29:06 +03:00

39 lines
625 B
Go

//go:build darwin || freebsd || linux || openbsd
package aghos
import (
"io/fs"
"os"
"os/signal"
"golang.org/x/sys/unix"
)
func rootDirFS() (fsys fs.FS) {
return os.DirFS("/")
}
func notifyReconfigureSignal(c chan<- os.Signal) {
signal.Notify(c, unix.SIGHUP)
}
func notifyShutdownSignal(c chan<- os.Signal) {
signal.Notify(c, unix.SIGINT, unix.SIGQUIT, unix.SIGTERM)
}
func isReconfigureSignal(sig os.Signal) (ok bool) {
return sig == unix.SIGHUP
}
func isShutdownSignal(sig os.Signal) (ok bool) {
switch sig {
case
unix.SIGINT,
unix.SIGQUIT,
unix.SIGTERM:
return true
default:
return false
}
}