]> source.dussan.org Git - rspamd.git/commitdiff
Initialize PRG after fork.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 24 Aug 2014 15:54:28 +0000 (16:54 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 24 Aug 2014 15:54:28 +0000 (16:54 +0100)
src/main.c

index c1fa93815b26784f085e2eeadd2b70eb9df9f906..85553dfc1babd4711f6654e5a0a0b865fc364c9c 100644 (file)
@@ -233,6 +233,7 @@ read_cmd_line (gint argc, gchar **argv, struct rspamd_config *cfg)
                r = fork ();
                if (r == 0) {
                        /* Spawning new main process */
+                       ottery_init (NULL);
                        cfg->cfg_name = cfg_names[i];
                        (void)setsid ();
                }
@@ -502,6 +503,7 @@ fork_worker (struct rspamd_main *rspamd, struct rspamd_worker_conf *cf)
                        update_log_pid (cf->type, rspamd->logger);
                        /* Lock statfile pool if possible */
                        statfile_pool_lockall (rspamd->statfile_pool);
+                       ottery_init (NULL);
                        /* Drop privilleges */
                        drop_priv (rspamd);
                        /* Set limits */
@@ -1310,6 +1312,7 @@ main (gint argc, gchar **argv, gchar **env)
                exit (-errno);
        }
 
+       ottery_init (NULL);
        /* Write info */
        rspamd_main->pid = getpid ();
        rspamd_main->type = type;