]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: restore console color support for containers (#3595)
authorFranck Bui <fbui@suse.com>
Fri, 24 Jun 2016 14:08:43 +0000 (16:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Jun 2016 14:08:43 +0000 (16:08 +0200)
Commit 3a18b60489504056f9b0b1a139439cbfa60a87e1 introduced a regression that
disabled the color mode for container.

This patch fixes this.

src/core/main.c

index 237c9c9ebe9d58909e28498e977b855c3e4881d6..3d74ef1adfaff68cc965659aa19291cdff39f154 100644 (file)
@@ -1507,13 +1507,14 @@ int main(int argc, char *argv[]) {
                         (void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
         }
 
-        /* We expect the environment to be set correctly if run inside a
-         * container. */
-        if (arg_system && detect_container() <= 0) {
-                if (fixup_environment() < 0) {
-                        error_message = "Failed to fix up PID1 environment";
-                        goto finish;
-                }
+        if (arg_system) {
+                /* We expect the environment to be set correctly
+                 * if run inside a container. */
+                if (detect_container() <= 0)
+                        if (fixup_environment() < 0) {
+                                error_message = "Failed to fix up PID1 environment";
+                                goto finish;
+                        }
 
                 /* Try to figure out if we can use colors with the console. No
                  * need to do that for user instances since they never log