]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Move import_environment setting to lib-master's master_service_settings
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 7 Jun 2017 21:14:30 +0000 (00:14 +0300)
committerGitLab <gitlab@git.dovecot.net>
Sat, 10 Jun 2017 08:35:40 +0000 (11:35 +0300)
src/lib-master/master-service-settings.c
src/lib-master/master-service-settings.h
src/master/main.c
src/master/master-settings.c
src/master/master-settings.h

index c58de51be8dfb4bcc3530cc96ba4d9a2301cd4bb..0902d4acbaf905f79deb959a37ea3c54ec7ec90a 100644 (file)
@@ -42,6 +42,7 @@ static const struct setting_define master_service_setting_defines[] = {
        DEF(SET_STR, debug_log_path),
        DEF(SET_STR, log_timestamp),
        DEF(SET_STR, syslog_facility),
+       DEF(SET_STR, import_environment),
        DEF(SET_SIZE, config_cache_size),
        DEF(SET_BOOL, version_ignore),
        DEF(SET_BOOL, shutdown_clients),
@@ -53,6 +54,19 @@ static const struct setting_define master_service_setting_defines[] = {
        SETTING_DEFINE_LIST_END
 };
 
+/* <settings checks> */
+#ifdef HAVE_SYSTEMD
+#  define ENV_SYSTEMD " LISTEN_PID LISTEN_FDS"
+#else
+#  define ENV_SYSTEMD ""
+#endif
+#ifdef DEBUG
+#  define ENV_GDB " GDB DEBUG_SILENT"
+#else
+#  define ENV_GDB ""
+#endif
+/* </settings checks> */
+
 static const struct master_service_settings master_service_default_settings = {
        .base_dir = PKG_RUNDIR,
        .state_dir = PKG_STATEDIR,
@@ -61,6 +75,7 @@ static const struct master_service_settings master_service_default_settings = {
        .debug_log_path = "",
        .log_timestamp = DEFAULT_FAILURE_STAMP_FORMAT,
        .syslog_facility = "mail",
+       .import_environment = "TZ CORE_OUTOFMEM CORE_ERROR" ENV_SYSTEMD ENV_GDB,
        .config_cache_size = 1024*1024,
        .version_ignore = FALSE,
        .shutdown_clients = TRUE,
index b1210eda9982424f6159303f1c8145906ce9a562..67ae9bcade1471cc15ab151579cdb441bd558ca3 100644 (file)
@@ -15,6 +15,7 @@ struct master_service_settings {
        const char *debug_log_path;
        const char *log_timestamp;
        const char *syslog_facility;
+       const char *import_environment;
        uoff_t config_cache_size;
        bool version_ignore;
        bool shutdown_clients;
index e6ad1966e3b3898cb28df43d12d668b0820e4303..9bab46402d69131d2586b482c766c87b0399f3d0 100644 (file)
@@ -421,7 +421,8 @@ static struct master_settings *master_settings_read(void)
        return master_service_settings_get_others(master_service)[0];
 }
 
-static void master_set_import_environment(const struct master_settings *set)
+static void
+master_set_import_environment(const struct master_service_settings *set)
 {
        const char *const *envs, *key, *value;
        ARRAY_TYPE(const_string) keys;
@@ -846,7 +847,7 @@ int main(int argc, char *argv[])
        fatal_log_check(set);
 
        T_BEGIN {
-               master_set_import_environment(set);
+               master_set_import_environment(master_service_settings_get(master_service));
        } T_END;
        master_service_env_clean();
 
index 3e416da72cbdbb22bdc656ac0d98716062d0f815..4fc73aefbeafbf922c515df2eb5c86376185c50e 100644 (file)
@@ -178,7 +178,6 @@ static const struct setting_define master_setting_defines[] = {
        DEF(SET_STR, state_dir),
        DEF(SET_STR, libexec_dir),
        DEF(SET_STR, instance_name),
-       DEF(SET_STR, import_environment),
        DEF(SET_STR, protocols),
        DEF(SET_STR, listen),
        DEF(SET_ENUM, ssl),
@@ -201,25 +200,11 @@ static const struct setting_define master_setting_defines[] = {
        SETTING_DEFINE_LIST_END
 };
 
-/* <settings checks> */
-#ifdef HAVE_SYSTEMD
-#  define ENV_SYSTEMD " LISTEN_PID LISTEN_FDS"
-#else
-#  define ENV_SYSTEMD ""
-#endif
-#ifdef DEBUG
-#  define ENV_GDB " GDB DEBUG_SILENT"
-#else
-#  define ENV_GDB ""
-#endif
-/* </settings checks> */
-
 static const struct master_settings master_default_settings = {
        .base_dir = PKG_RUNDIR,
        .state_dir = PKG_STATEDIR,
        .libexec_dir = PKG_LIBEXECDIR,
        .instance_name = PACKAGE,
-       .import_environment = "TZ CORE_OUTOFMEM CORE_ERROR" ENV_SYSTEMD ENV_GDB,
        .protocols = "imap pop3 lmtp",
        .listen = "*, ::",
        .ssl = "yes:no:required",
index 2b97c42ec73a7ab1dcb42d67311ff77d2a920805..5bba84d2fa0b0b19dbc9c7938da79b51fa286c1c 100644 (file)
@@ -8,7 +8,6 @@ struct master_settings {
        const char *state_dir;
        const char *libexec_dir;
        const char *instance_name;
-       const char *import_environment;
        const char *protocols;
        const char *listen;
        const char *ssl;