Browse Source

Merge "journal-to-console: element to send systemd journal to console"

tags/2.26.0
Zuul 1 month ago
parent
commit
a0c6d16e1c

+ 10
- 0
diskimage_builder/elements/journal-to-console/README.rst View File

@@ -0,0 +1,10 @@
1
+==================
2
+journal-to-console
3
+==================
4
+
5
+Configure systemd's journal to send all logs to console.  Useful for
6
+debugging issues before you can log into a host, such as network or
7
+authentication issues.
8
+
9
+The console can be retrieved from an OpenStack cloud with a command
10
+such as ``openstack console log show <server>``.

+ 28
- 0
diskimage_builder/elements/journal-to-console/post-install.d/30-journal-to-console View File

@@ -0,0 +1,28 @@
1
+#!/bin/bash
2
+#
3
+# Copyright 2019 Red Hat, Inc.
4
+#
5
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+# not use this file except in compliance with the License. You may obtain
7
+# a copy of the License at
8
+#
9
+#     http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+# Unless required by applicable law or agreed to in writing, software
12
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+# License for the specific language governing permissions and limitations
15
+# under the License.
16
+
17
+if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
18
+    set -x
19
+fi
20
+set -eu
21
+set -o pipefail
22
+
23
+mkdir -p /etc/systemd/journald.conf.d
24
+
25
+cat > /etc/systemd/journald.conf.d/log-to-console.conf << EOF
26
+[Journal]
27
+ForwardToConsole=true
28
+EOF

+ 6
- 0
releasenotes/notes/journal-console-752b46542ec5595e.yaml View File

@@ -0,0 +1,6 @@
1
+---
2
+features:
3
+  - |
4
+    The ``journal-to-console`` element is added to allow forwarding
5
+    systemd output to the host console.  This is useful for debugging
6
+    early boot issues.

Loading…
Cancel
Save