]> source.dussan.org Git - rspamd.git/commitdiff
Do not fail if pid file is not specified in config
authorMikhail Gusarov <dottedmag@debian.org>
Sat, 7 Mar 2015 10:15:16 +0000 (10:15 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 8 Mar 2015 22:42:50 +0000 (22:42 +0000)
src/main.c

index 10b1c905f1edcc7c5f0780ce2f51652cc6baf976..0f2ceb3607ec078be0d10f48860bd4fecffb3cad 100644 (file)
@@ -1335,7 +1335,9 @@ main (gint argc, gchar **argv, gchar **env)
 
        rspamd_signals_init (&signals, sig_handler);
 
-       if (rspamd_write_pid (rspamd_main) == -1) {
+       if (rspamd_main->cfg->pid_file == NULL) {
+               msg_info("pid file is not specified, skipping writing it");
+       } else if (rspamd_write_pid (rspamd_main) == -1) {
                msg_err ("cannot write pid file %s", rspamd_main->cfg->pid_file);
                exit (-errno);
        }