diff options
Diffstat (limited to 'nslcd_systemd')
-rw-r--r-- | nslcd_systemd/nslcd_systemd.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nslcd_systemd/nslcd_systemd.go b/nslcd_systemd/nslcd_systemd.go index eb545c2..35c9393 100644 --- a/nslcd_systemd/nslcd_systemd.go +++ b/nslcd_systemd/nslcd_systemd.go @@ -38,8 +38,8 @@ import ( "os" "os/signal" "sync" - "syscall" + "golang.org/x/sys/unix" "lukeshu.com/git/go/libnslcd.git/nslcd_server" "lukeshu.com/git/go/libsystemd.git/sd_daemon" "lukeshu.com/git/go/libsystemd.git/sd_daemon/lsb" @@ -69,13 +69,13 @@ func get_socket() (socket net.Listener, err error) { return } -func getpeercred(conn *net.UnixConn) (cred syscall.Ucred, err error) { +func getpeercred(conn *net.UnixConn) (cred unix.Ucred, err error) { file, err := conn.File() if err != nil { return } defer file.Close() - _cred, err := syscall.GetsockoptUcred(int(file.Fd()), syscall.SOL_SOCKET, syscall.SO_PEERCRED) + _cred, err := unix.GetsockoptUcred(int(file.Fd()), unix.SOL_SOCKET, unix.SO_PEERCRED) cred = *_cred return } @@ -99,7 +99,7 @@ func Main(backend Backend) uint8 { var err error = nil sigs := make(chan os.Signal) - signal.Notify(sigs, syscall.SIGTERM, syscall.SIGHUP) + signal.Notify(sigs, unix.SIGTERM, unix.SIGHUP) disable_nss_module() @@ -140,10 +140,10 @@ func Main(backend Backend) uint8 { select { case sig := <-sigs: switch sig { - case syscall.SIGTERM: + case unix.SIGTERM: sd_daemon.Log.Notice("Received SIGTERM, shutting down") return lsb.EXIT_SUCCESS - case syscall.SIGHUP: + case unix.SIGHUP: sd_daemon.Notify(0, false, "RELOADING=1", nil) err := backend.Reload() if err != nil { |