summaryrefslogtreecommitdiff
path: root/nslcd_systemd/nslcd_systemd.go
diff options
context:
space:
mode:
Diffstat (limited to 'nslcd_systemd/nslcd_systemd.go')
-rw-r--r--nslcd_systemd/nslcd_systemd.go13
1 files changed, 6 insertions, 7 deletions
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)
}()