From 346605c8cfdcdc39d7b614f114877b411fa63bda Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 1 Jan 2017 19:16:48 -0700 Subject: Update for new libsystemd. --- nslcd_systemd/nslcd_systemd.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'nslcd_systemd') diff --git a/nslcd_systemd/nslcd_systemd.go b/nslcd_systemd/nslcd_systemd.go index 35c9393..65c0331 100644 --- a/nslcd_systemd/nslcd_systemd.go +++ b/nslcd_systemd/nslcd_systemd.go @@ -42,7 +42,6 @@ import ( "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" ) type Backend interface { @@ -107,7 +106,7 @@ func Main(backend Backend) uint8 { if err != nil { sd_daemon.Log.Err(fmt.Sprintf("Could not initialize backend: %v", err)) sd_daemon.Notify(0, false, "STOPPING=1", nil) - return lsb.EXIT_FAILURE + return sd_daemon.EXIT_FAILURE } defer backend.Close() @@ -115,12 +114,12 @@ func Main(backend Backend) uint8 { if err != nil { sd_daemon.Log.Err(fmt.Sprintf("%v", err)) sd_daemon.Notify(0, false, "STOPPING=1", nil) - return lsb.EXIT_NOTRUNNING + return sd_daemon.EXIT_NOTRUNNING } defer socket.Close() sock := make(chan *net.UnixConn) go func() { - defer lsb.Recover() + defer sd_daemon.Recover() for { conn, err := socket.Accept() if err != nil { @@ -142,20 +141,20 @@ func Main(backend Backend) uint8 { switch sig { case unix.SIGTERM: sd_daemon.Log.Notice("Received SIGTERM, shutting down") - return lsb.EXIT_SUCCESS + return sd_daemon.EXIT_SUCCESS case unix.SIGHUP: sd_daemon.Notify(0, false, "RELOADING=1", nil) err := backend.Reload() if err != nil { sd_daemon.Log.Notice(fmt.Sprintf("Could not reload backend: %s", err.Error())) - return lsb.EXIT_NOTRUNNING + return sd_daemon.EXIT_NOTRUNNING } sd_daemon.Notify(0, false, "READY=1", nil) } case conn := <-sock: wg.Add(1) go func() { - defer lsb.Recover() + defer sd_daemon.Recover() defer wg.Done() handler(conn, backend) }() -- cgit v1.2.3-2-g168b