diff options
Diffstat (limited to 'src/nslcd_systemd')
-rw-r--r-- | src/nslcd_systemd/nslcd_systemd.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nslcd_systemd/nslcd_systemd.go b/src/nslcd_systemd/nslcd_systemd.go index 8d7d4fb..ad92f52 100644 --- a/src/nslcd_systemd/nslcd_systemd.go +++ b/src/nslcd_systemd/nslcd_systemd.go @@ -15,7 +15,9 @@ import ( type Backend interface { nslcd_proto.Backend + Init() error Reload() error + Close() } func get_socket() (socket net.Listener, err error) { @@ -72,6 +74,14 @@ func Main(backend Backend) uint8 { disable_nss_module() + err = backend.Init() + if err != nil { + logger.Err("%s", err.Error()) + sd.Notify(false, "STOPPING=1") + return lsb.EXIT_FAILURE + } + defer backend.Close() + socket, err = get_socket() if err != nil { logger.Err("%s", err.Error()) |