[lxc-devel] [PATCH] Move lxc-monitord.log out of /var/lib/lxc/

Robert Vogelgesang vogel at users.sourceforge.net
Fri Apr 4 17:04:03 UTC 2014


Place log file into LOGPATH instead of LXCPATH (but still use the
given lxcpath if the latter differs from LXCPATH).

Signed-off-by: Robert Vogelgesang <vogel at users.sourceforge.net>

diff -up lxc-1.0.2/src/lxc/lxc_monitord.c.monitordlogpath lxc-1.0.2/src/lxc/lxc_monitord.c
--- lxc-1.0.2/src/lxc/lxc_monitord.c.monitordlogpath	2014-03-27 20:10:33.000000000 +0100
+++ lxc-1.0.2/src/lxc/lxc_monitord.c	2014-04-03 18:28:49.509852307 +0200
@@ -348,7 +348,7 @@ int main(int argc, char *argv[])
 	}
 
 	ret = snprintf(logpath, sizeof(logpath), "%s/lxc-monitord.log",
-		       lxcpath);
+		       (strcmp(LXCPATH, lxcpath) ? lxcpath : LOGPATH ) );
 	if (ret < 0 || ret >= sizeof(logpath))
 		return EXIT_FAILURE;
 


More information about the lxc-devel mailing list