]> the.earth.li Git - onak.git/commitdiff
Don't catch signals if we're using the keyd backend
authorJonathan McDowell <noodles@earth.li>
Fri, 15 Sep 2023 05:28:31 +0000 (10:58 +0530)
committerJonathan McDowell <noodles@earth.li>
Fri, 15 Sep 2023 05:28:31 +0000 (10:58 +0530)
Catching signals dates from when we didn't have the keyd backend and
install every process opened the DB4 files itself. This lead to major
issues if the process didn't clean up correctly. If we're using keyd
there's no such concern, so we can avoid catching signals and preventing
things like Ctrl-C working for the CLI tool.

cleanup.c

index 3fe219fb4c02127a928335a969b1e33745ebe956..95f74ddc3a867c8c63ba28b4a54a4ab8cc29e414 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -21,6 +21,7 @@
 
 #include "cleanup.h"
 #include "log.h"
+#include "onak-conf.h"
 
 static bool should_cleanup = false;
 
@@ -72,6 +73,10 @@ void sig_cleanup(int signal)
  */
 void catchsignals(void)
 {
+       if (config.use_keyd) {
+               return;
+       }
+
        logthing(LOGTHING_INFO, "Catching signals");
 
        signal(SIGALRM, &sig_cleanup);