comparison src/conf.c @ 421:f37384470855

Changed lockdir to /var/lock/masqmail; Create lockdir and piddir on startup. Moved the lockdir out of the spool dir. (When /var/lock is a ramdisk we do well to have the lock files there.) Added the new configure option --with-lockdir to change that location. Nontheless, if we run_as_user, then lock files are always stored in the spool dir directly. Instead of installing the lockdir and piddir at installation time, we create them on startup time now if they are missing. This is necessary if lockdir or piddir are a tmpfs.
author markus schnalke <meillo@marmaro.de>
date Wed, 30 May 2012 09:38:38 +0200
parents 8a62bebda631
children e972c3cbe1e0
comparison
equal deleted inserted replaced
420:09da6e72cd30 421:f37384470855
403 403
404 conf.do_relay = TRUE; 404 conf.do_relay = TRUE;
405 conf.localpartcmp = strcmp; 405 conf.localpartcmp = strcmp;
406 conf.max_defer_time = 86400 * 4; /* 4 days */ 406 conf.max_defer_time = 86400 * 4; /* 4 days */
407 conf.max_msg_size = 0; /* no limit on msg size */ 407 conf.max_msg_size = 0; /* no limit on msg size */
408 conf.lock_dir = LOCK_DIR;
408 conf.spool_dir = SPOOL_DIR; 409 conf.spool_dir = SPOOL_DIR;
409 conf.mail_dir = "/var/mail"; 410 conf.mail_dir = "/var/mail";
410 411
411 if (!(in = fopen(filename, "r"))) { 412 if (!(in = fopen(filename, "r"))) {
412 logwrite(LOG_ALERT, "could not open config file %s: %s\n", 413 logwrite(LOG_ALERT, "could not open config file %s: %s\n",
536 conf.errmsg_file = g_strdup(DATA_DIR "/tpl/failmsg.tpl"); 537 conf.errmsg_file = g_strdup(DATA_DIR "/tpl/failmsg.tpl");
537 } 538 }
538 if (!conf.warnmsg_file) { 539 if (!conf.warnmsg_file) {
539 conf.warnmsg_file = g_strdup(DATA_DIR "/tpl/warnmsg.tpl"); 540 conf.warnmsg_file = g_strdup(DATA_DIR "/tpl/warnmsg.tpl");
540 } 541 }
541 if (!conf.lock_dir) {
542 conf.lock_dir = g_strdup_printf("%s/lock/", conf.spool_dir);
543 }
544 if (!conf.mbox_default) { 542 if (!conf.mbox_default) {
545 conf.mbox_default = g_strdup("mbox"); 543 conf.mbox_default = g_strdup("mbox");
546 } 544 }
547 if (!conf.warn_intervals) { 545 if (!conf.warn_intervals) {
548 conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", TRUE); 546 conf.warn_intervals = parse_list("1h;4h;8h;1d;2d;3d", TRUE);