diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index a080870..513c249 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -52,6 +52,7 @@ #include "monitor/monitor_interfaces.h" #include "responder/common/responder_sbus.h" #include "util/inotify.h" +#include "tools/common/sss_process.h" #ifdef USE_KEYRING #include @@ -2440,6 +2441,7 @@ int main(int argc, const char *argv[]) struct mt_ctx *monitor; int ret; uid_t uid; + pid_t pid; struct poptOption long_options[] = { POPT_AUTOHELP @@ -2622,10 +2624,13 @@ int main(int argc, const char *argv[]) /* Check if the SSSD is already running */ ret = check_file(SSSD_PIDFILE, 0, 0, S_IFREG|0600, 0, NULL, false); if (ret == EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, - "pidfile exists at %s\n", SSSD_PIDFILE); - ERROR("SSSD is already running\n"); - return 2; + ret = sss_signal(0); + if (ret == EOK) { + DEBUG(SSSDBG_FATAL_FAILURE, + "pidfile exists at %s\n", SSSD_PIDFILE); + ERROR("SSSD is already running\n"); + return 2; + } } /* Parse config file, fail if cannot be done */