]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #29586 from poettering/read-stripped-line
authorLuca Boccassi <bluca@debian.org>
Tue, 17 Oct 2023 18:54:14 +0000 (19:54 +0100)
committerGitHub <noreply@github.com>
Tue, 17 Oct 2023 18:54:14 +0000 (19:54 +0100)
add read_stripped_line() as trivial read_line() + strstrip() combo

32 files changed:
man/standard-conf.xml
meson.build
meson_options.txt
src/core/meson.build
src/core/system.conf.in
src/core/user.conf.in
src/coredump/coredump.conf
src/coredump/meson.build
src/home/homed.conf
src/home/meson.build
src/journal-remote/journal-remote.conf.in
src/journal-remote/journal-upload.conf.in
src/journal-remote/meson.build
src/journal/journald.conf
src/journal/meson.build
src/login/logind.conf.in
src/login/meson.build
src/network/meson.build
src/network/networkd.conf
src/oom/meson.build
src/oom/oomd.conf
src/pstore/meson.build
src/pstore/pstore.conf
src/resolve/meson.build
src/resolve/resolved.conf.in
src/sleep/meson.build
src/sleep/sleep.conf
src/timesync/meson.build
src/timesync/timesyncd.conf.in
src/udev/iocost/iocost.conf
src/udev/meson.build
test/units/testsuite-04.journal-remote.sh

index c4f287786429e8b8d4eaa589a1c7db1fb4894475..cc2b87401672db40257991643c3cb3d84b79f359 100644 (file)
 
     <para>The default configuration is set during compilation, so configuration is only needed when it is
     necessary to deviate from those defaults. The main configuration file is either in
-    <filename>/usr/lib/systemd</filename> or <filename>/etc/systemd/</filename> and contains commented out
+    <filename>/usr/lib/systemd/</filename> or <filename>/etc/systemd/</filename> and contains commented out
     entries showing the defaults as a guide to the administrator. Local overrides can be created by creating
     drop-ins, as described below. The main configuration file can also be edited for this purpose (or a copy
-    in <filename>/etc</filename> if it's shipped in <filename>/usr</filename>) however using drop-ins for
+    in <filename>/etc/</filename> if it's shipped in <filename>/usr/</filename>) however using drop-ins for
     local configuration is recommended over modifications to the main configuration file.</para>
 
     <para>In addition to the "main" configuration file, drop-in configuration snippets are read from
index 356e1839e9178ca2b6903fe439d8f924894754ac..7f5d465783b998d405a40a3842580d6e9df359be 100644 (file)
@@ -175,6 +175,12 @@ repartdefinitionsdir = libexecdir / 'repart/definitions'
 ntpservicelistdir = prefixdir / 'lib/systemd/ntp-units.d'
 credstoredir = prefixdir / 'lib/credstore'
 
+configfiledir = get_option('configfiledir')
+if configfiledir == ''
+        configfiledir= sysconfdir
+endif
+pkgconfigfiledir = configfiledir / 'systemd'
+
 docdir = get_option('docdir')
 if docdir == ''
         docdir = datadir / 'doc/systemd'
index b8116bcedde12ec8e24a83982ecf12176e869f79..831d23e299a785240d066b18312d6cd8cc5b669c 100644 (file)
@@ -210,7 +210,9 @@ option('libcryptsetup-plugins-dir', type : 'string',
 option('docdir', type : 'string',
        description : 'documentation directory')
 option('install-sysconfdir', type : 'combo', choices : ['true', 'no-samples', 'false'], value : 'true',
-       description : 'install configuration files and directories to $sysconfdir')
+       description : 'install configuration files and directories')
+option('configfiledir', type : 'string', value : '',
+       description : 'directory for configuration files')
 
 option('fallback-hostname', type : 'string', value : 'localhost',
        description : 'the hostname used if none configured')
index 44af28a3f32df4e81b40f4c00ae8cb756697fe51..ce20b51aec136254c7bee46a1ee34cbfaa85a5e3 100644 (file)
@@ -194,8 +194,8 @@ executables += [
         },
 ]
 
-in_files = [['system.conf',                     pkgsysconfdir],
-            ['user.conf',                       pkgsysconfdir],
+in_files = [['system.conf',                     pkgconfigfiledir],
+            ['user.conf',                       pkgconfigfiledir],
             ['org.freedesktop.systemd1.policy', polkitpolicydir]]
 
 foreach item : in_files
@@ -207,7 +207,7 @@ foreach item : in_files
                 input : file + '.in',
                 output: file,
                 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
-                install : (dir == pkgsysconfdir) ? install_sysconfdir_samples : (dir != 'no'),
+                install : (dir == pkgconfigfiledir) ? install_sysconfdir_samples : (dir != 'no'),
                 install_dir : dir)
 endforeach
 
index 812531fe8b21dcd0660091835ab271138c3b43de..05eb6812700640605553482cbb50a6a8a4aee2d3 100644 (file)
@@ -7,10 +7,10 @@
 #
 # Entries in this file show the compile time defaults. Local configuration
 # should be created by either modifying this file (or a copy of it placed in
-# /etc if the original file is shipped in /usr), or by creating "drop-ins" in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
 # /etc/systemd/system.conf.d/ directory. The latter is generally recommended.
 # Defaults can be restored by simply deleting the main configuration file and
-# all drop-ins located in /etc.
+# all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/system.conf' to display the full config.
 #
index a445dff5d041436dbae38f54eddaa5d625e394b3..14f0eae7f8a7308162cf04de1a7e098cf3149544 100644 (file)
@@ -6,9 +6,13 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the user.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/user.conf.d/ directory. The latter is generally recommended.
+# Defaults can be restored by simply deleting the main configuration file and
+# all drop-ins located in /etc/.
+#
+# Use 'systemd-analyze cat-config systemd/user.conf' to display the full config.
 #
 # See systemd-user.conf(5) for details.
 
index 8d52d8ded7dbac1cd2d4f9e15cdd78d60752b1bf..ae341e40d72840da02b14fe8a7ee5e051347d7d7 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the coredump.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/coredump.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/coredump.conf' to display the full config.
 #
index ba313ce42e6fc58f5644288102e598853b50491a..a69974672cce4167538b6346889b2ee1038c693d 100644 (file)
@@ -44,5 +44,5 @@ executables += [
 
 if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
         install_data('coredump.conf',
-                     install_dir : pkgsysconfdir)
+                     install_dir : pkgconfigfiledir)
 endif
index d3a685e81649fb96491c99a85af8942b43f9cc16..993122ba7b6b7842bc950a788ccf1365cac9b429 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the homed.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/homed.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/homed.conf' to display the full config.
 #
index 8dcc4d41f679ae5f758f5b4fa4c02154bbc08224..b909cfdd47b92009851c2afe8410800da8218c0c 100644 (file)
@@ -135,6 +135,6 @@ if conf.get('ENABLE_HOMED') == 1
 
         if install_sysconfdir_samples
                 install_data('homed.conf',
-                             install_dir : pkgsysconfdir)
+                             install_dir : pkgconfigfiledir)
         endif
 endif
index 297710af1357d3eee9f32a68c0dda633802852ed..e517569a6b67a3c3aac0f891b50cf84de227dd6c 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the journal-remote.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/journal-remote.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/journal-remote.conf' to display the full config.
 #
index dd3743c22630bb0b873eca0e7d994807f7877182..41c53b63105f03625aa99fce24cfa340512823ff 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the journal-upload.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/journal-upload.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/journal-upload.conf' to display the full config.
 #
index 4251624864059018f634015421e494fb4e2a4f02..964a2517744fd91fe4ce5add3a4e319a33f0e1f7 100644 (file)
@@ -102,7 +102,7 @@ foreach tuple : in_files
                 output: file,
                 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
                 install : tuple[1],
-                install_dir : pkgsysconfdir)
+                install_dir : pkgconfigfiledir)
 endforeach
 
 if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
index 5a60a9d39c59f4db643cbaf2c028d260e85c0455..7b9e23205e5bb7f9ece85a98d82594a29719dac9 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the journald.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/journald.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/journald.conf' to display the full config.
 #
index 4187dab6734653f369eef2300866d9ed36941f6b..36600bf2c6e17c63ba5cf823ab292deb8153c4a6 100644 (file)
@@ -163,7 +163,7 @@ executables += [
 
 if install_sysconfdir_samples
         install_data('journald.conf',
-                     install_dir : pkgsysconfdir)
+                     install_dir : pkgconfigfiledir)
 endif
 
 if get_option('create-log-dirs')
index 0b10df68399d4c96bae72c574e103dc38b7fbdd4..e5fe924681134933f139b3b7cdd9159955e0aeda 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the logind.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/logind.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
 #
index 1ba996d51711605dc21cc5b7085c2d57964815df..6fb09b48e2a9b9e89fdc94be6defedbbf356f47d 100644 (file)
@@ -124,7 +124,7 @@ custom_target(
         output : 'logind.conf',
         command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
         install : enable_logind and install_sysconfdir_samples and pkgsysconfdir != 'no',
-        install_dir : pkgsysconfdir)
+        install_dir : pkgconfigfiledir)
 
 custom_target(
         'systemd-user',
index 2ca9eac714b3ee329bf431cc82e4ba622656f1c6..5c05eba095531dc8ba7bcaff653223ae61e2b87c 100644 (file)
@@ -261,6 +261,6 @@ if conf.get('ENABLE_NETWORKD') == 1
 
         if install_sysconfdir_samples
                 install_data('networkd.conf',
-                             install_dir : pkgsysconfdir)
+                             install_dir : pkgconfigfiledir)
         endif
 endif
index 2000eac4abb04aea0bce536407ec195af86cd572..e5a5e8892621a11b66a6ab18504992511db6bf58 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the networkd.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/networkd.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/networkd.conf' to display the full config.
 #
index d2f4c076e31152d6d3f87655746590c4ce6ced09..690ed7ac6bc028b235fa301bb8ed8af6c8de95d8 100644 (file)
@@ -39,6 +39,6 @@ if conf.get('ENABLE_OOMD') == 1
 
         if install_sysconfdir_samples
                 install_data('oomd.conf',
-                             install_dir : pkgsysconfdir)
+                             install_dir : pkgconfigfiledir)
         endif
 endif
index b3a457f887738c009ea3ea4166cadcad749fd624..1c8fa7684d345964fbdd0442282c17ffe5cb42ea 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the oomd.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/oomd.conf.d/ directory. The latter is generally recommended.
+# Defaults can be restored by simply deleting the main configuration file and
+# all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/oomd.conf' to display the full config.
 #
index 122ba2ee3ee3a13cee3d7ec3b7182adab9b57ea7..b6fda8723d552cf93df112172488d470bff6843f 100644 (file)
@@ -17,5 +17,5 @@ executables += [
 
 if conf.get('ENABLE_PSTORE') == 1 and install_sysconfdir_samples
         install_data('pstore.conf',
-                     install_dir : pkgsysconfdir)
+                     install_dir : pkgconfigfiledir)
 endif
index f43924b0cbddeaff68d8e3232690f57abc113b8f..22b18b586f44e2a717a8ead349e2ffd2dc80fa3e 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the pstore.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/pstore.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/pstore.conf' to display the full config.
 #
index 2c34dc50322553c93110e0d477f52c810ad76d8c..e7867e2f85afe63b9021b47d929cf9fe76f38e9a 100644 (file)
@@ -237,4 +237,4 @@ custom_target(
         output : 'resolved.conf',
         command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
         install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples,
-        install_dir : pkgsysconfdir)
+        install_dir : pkgconfigfiledir)
index f003574ac5efc86580ecf377a9199f5dc5edfd02..0031b156b1f512d1743296f64b47f9c79b2df453 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the resolved.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/resolved.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
 #
index da44ee6dcabd6d71c1d4d8872d7a74214a2113eb..fc0037e3876cdf489baee0fccc2f9c9701d0fbef 100644 (file)
@@ -18,5 +18,5 @@ executables += [
 
 if install_sysconfdir_samples
         install_data('sleep.conf',
-                     install_dir : pkgsysconfdir)
+                     install_dir : pkgconfigfiledir)
 endif
index 9fa44a47639f3e3872997d63fb95d55dd7254a25..8428821b52519bc9c8a4a2c40ca986f6d66dfdae 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the sleep.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/sleep.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/sleep.conf' to display the full config.
 #
index 27367e311e96740e87e7a2d7a9a137cc84009a84..684448097c6294f8887e96467b02ff8edf8c7a33 100644 (file)
@@ -66,7 +66,7 @@ custom_target(
         output : 'timesyncd.conf',
         command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
         install : conf.get('ENABLE_TIMESYNCD') == 1 and install_sysconfdir_samples,
-        install_dir : pkgsysconfdir)
+        install_dir : pkgconfigfiledir)
 
 if conf.get('ENABLE_TIMESYNCD') == 1
         install_data('org.freedesktop.timesync1.conf',
index b110be59202c3d2c39495ca13a9daf28bdf80dc3..6ef41cf0c50b67d1e7280f5fa2c80ed2b854abca 100644 (file)
@@ -6,9 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file, or by creating "drop-ins" in
-# the timesyncd.conf.d/ subdirectory. The latter is generally recommended.
-# Defaults can be restored by simply deleting this file and all drop-ins.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/timesyncd.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config systemd/timesyncd.conf' to display the full config.
 #
index 394ea349ee24840910d8aa4ed0653273dc9c69a8..c0eeea363585c4223487ea81c0e2d72bad047000 100644 (file)
@@ -6,8 +6,11 @@
 #  any later version.
 #
 # Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file. Defaults can be restored by
-# simply deleting this file.
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/udev/iocost.conf.d/ directory. The latter is generally recommended.
+# Defaults can be restored by simply deleting the main configuration file and
+# all drop-ins located in /etc/.
 #
 # Use 'systemd-analyze cat-config udev/iocost.conf' to display the full config.
 #
index cd4d1f42775fe7d26409fe259c58bfe267d6eb39..ac9a4c3ccae5fdedd63d66801c3c32ca5fbd40cb 100644 (file)
@@ -253,9 +253,9 @@ meson.add_install_script(sh, '-c', ln_s.format(bindir / 'udevadm',
 
 if install_sysconfdir_samples
         install_data('udev.conf',
-                     install_dir : sysconfdir / 'udev')
+                     install_dir : configfiledir / 'udev')
         install_data('iocost/iocost.conf',
-                     install_dir : sysconfdir / 'udev')
+                     install_dir : configfiledir / 'udev')
 endif
 
 udev_pc = custom_target(
index c0b95caec34fb99e5dcc29f82fc9f8dbbf5c7b56..c543129da954d8bef075610588532892df485eb9 100755 (executable)
@@ -209,6 +209,12 @@ ServerCertificateFile=/run/systemd/journal-remote-tls/cert.pem
 TrustedCertificateFile=/run/systemd/remote-pki/ca.crt
 EOF
 systemd-analyze cat-config systemd/journal-upload.conf
+mkdir -p /run/systemd/system/systemd-journal-upload.service.d
+cat >/run/systemd/system/systemd-journal-upload.service.d/99-test.conf <<EOF
+[Service]
+Restart=no
+EOF
+systemctl daemon-reload
 setfacl -R -m "u:systemd-journal-upload:rwX" /run/systemd/journal-remote-tls
 
 systemctl restart systemd-journal-upload