changeset 19993:9e844498398e

lib-master: Preserve LOG_STDERR_TIMESTAMP environment through doveconf exec. This should be needed only for standalone programs, so don't bother trying to preserve it otherwise.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 07 Apr 2016 16:35:28 +0300
parents 8bb067f6d2d3
children c497744ad9ba
files src/lib-master/master-service-settings.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-master/master-service-settings.c	Tue Apr 05 20:14:15 2016 +0300
+++ b/src/lib-master/master-service-settings.c	Thu Apr 07 16:35:28 2016 +0300
@@ -107,7 +107,7 @@
 			   const struct master_service_settings_input *input)
 {
 	const char **conf_argv, *binary_path = service->argv[0];
-	const char *home = NULL, *user = NULL;
+	const char *home = NULL, *user = NULL, *timestamp = NULL;
 	unsigned int i, argv_max_count;
 
 	(void)t_binary_abspath(&binary_path);
@@ -117,11 +117,15 @@
 			home = getenv("HOME");
 		if (input->preserve_user)
 			user = getenv("USER");
+		if ((service->flags & MASTER_SERVICE_FLAG_STANDALONE) != 0)
+			timestamp = getenv("LOG_STDERR_TIMESTAMP");
 		master_service_env_clean();
 		if (home != NULL)
 			env_put(t_strconcat("HOME=", home, NULL));
 		if (user != NULL)
 			env_put(t_strconcat("USER=", user, NULL));
+		if (timestamp != NULL)
+			env_put(t_strconcat("LOG_STDERR_TIMESTAMP=", timestamp, NULL));
 	}
 	if (input->use_sysexits)
 		env_put("USE_SYSEXITS=1");