-
Notifications
You must be signed in to change notification settings - Fork 1
/
0017-Add-journal-flush-service-for-Microsoft-Azure-VMs.patch
71 lines (67 loc) · 2.74 KB
/
0017-Add-journal-flush-service-for-Microsoft-Azure-VMs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 0628c6cd77457aff4b3dbd04e838d67195e8e481 Mon Sep 17 00:00:00 2001
From: Matthew Johnson <[email protected]>
Date: Tue, 20 Sep 2016 10:49:55 -0700
Subject: [PATCH 17/38] Add journal flush service for Microsoft Azure VMs
Removes "Before" clause when in a Microsoft VM.
---
units/meson.build | 4 +++-
units/systemd-journal-flush-msft.service.in | 22 +++++++++++++++++++++
units/systemd-journal-flush.service | 1 +
3 files changed, 26 insertions(+), 1 deletion(-)
create mode 100644 units/systemd-journal-flush-msft.service.in
diff --git a/units/meson.build b/units/meson.build
index 89ea147fbe..2278cac28a 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -194,7 +194,9 @@ in_units = [
'sysinit.target.wants/'],
['systemd-importd.service', 'ENABLE_IMPORTD',
'dbus-org.freedesktop.import1.service'],
- ['systemd-initctl.service', 'HAVE_SYSV_COMPAT'],
+ ['systemd-initctl.service', ''],
+ ['systemd-journal-flush-msft.service', '',
+ 'sysinit.target.wants/'],
['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'],
diff --git a/units/systemd-journal-flush-msft.service.in b/units/systemd-journal-flush-msft.service.in
new file mode 100644
index 0000000000..091d50c9fa
--- /dev/null
+++ b/units/systemd-journal-flush-msft.service.in
@@ -0,0 +1,22 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Flush Journal to Persistent Storage
+Documentation=man:systemd-journald.service(8) man:journald.conf(5)
+DefaultDependencies=no
+Requires=systemd-journald.service
+After=systemd-journald.service
+After=systemd-remount-fs.service
+RequiresMountsFor=/var/log/journal
+ConditionVirtualization=microsoft
+
+[Service]
+ExecStart=journalctl --flush
+Type=oneshot
+RemainAfterExit=yes
+TimeoutSec=90s
diff --git a/units/systemd-journal-flush.service b/units/systemd-journal-flush.service
index 5d0b811ae3..675145055c 100644
--- a/units/systemd-journal-flush.service
+++ b/units/systemd-journal-flush.service
@@ -16,6 +16,7 @@ After=systemd-journald.service systemd-remount-fs.service
Before=systemd-tmpfiles-setup.service
RequiresMountsFor=/var/log/journal
ConditionPathExists=!/etc/initrd-release
+ConditionVirtualization=!microsoft
[Service]
ExecStart=journalctl --flush
--
2.36.1