aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/state/exit.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/state/exit.go')
-rw-r--r--internal/state/exit.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/state/exit.go b/internal/state/exit.go
index 3da1f48e..4ba0a9d8 100644
--- a/internal/state/exit.go
+++ b/internal/state/exit.go
@@ -65,4 +65,23 @@ func BeforeExit() {
fmt.Printf("Stripped ACL entry for user '%s' from '%s'\n", u.Username, candidate)
}
}
+
+ if dbusProxy != nil {
+ if system.V.Verbose {
+ fmt.Println("D-Bus proxy registered, cleaning up")
+ }
+
+ if err := dbusProxy.Close(); err != nil {
+ if errors.Is(err, os.ErrClosed) {
+ if system.V.Verbose {
+ fmt.Println("D-Bus proxy already closed")
+ }
+ } else {
+ fmt.Println("Error closing D-Bus proxy:", err)
+ }
+ }
+
+ // wait for Proxy.Wait to return
+ <-*dbusDone
+ }
}