SHA256
1
0
forked from pool/systemd
systemd/handle-SYSTEMCTL_OPTIONS-environment-variable.patch

43 lines
1.8 KiB
Diff
Raw Normal View History

From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 22 Jan 2013 17:02:04 +0000
Subject: handle SYSTEMCTL_OPTIONS environment variable
(bnc#798620)
---
2013-04-19 22:31:17 +02:00
src/systemctl/systemctl.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
Accepting request 201848 from home:fcrozat:branches:Base:System (please fwd to 13.1 too) - Release v208: + logind gained support for facilitating privileged input and drm devices access for unprivileged clients (helps Wayland / kmscon). + New kernel command line luks.options= allows to specify LUKS options, when used with luks.uuid= + tmpfileS.d snippets can uses specifier expansion in path names (%m, %b, %H, %v). + New tmpfiles.d command "m" introduced to change owner/group/access mode of a file/directory only if it exists. + MemorySoftLimit= cgroup settings is no longer supported (underlying kernel cgroup attribute will disappear in the future). + memeory.use_hierarchy cgroup attribute is enabled for all cgroups systemd creates in memory cgroup hierarchy. + New filed _SYSTEMD_SLICE= is logged in journal messages related to a slice. + systemd-journald will no longer adjust the group of journal files it creates to "systemd-journal" group. Permissions and owernship is adjusted when package is upgraded. + Backlight and random seed files are now stored in /var/lib/systemd. + Boot time performance measurements included ACPI 5.0 FPDT informations if available. - Drop merged patches: 0001-cgroup-add-the-missing-setting-of-variable-s-value.patch, 0002-cgroup-correct-the-log-information.patch, 0003-cgroup-fix-incorrectly-setting-memory-cgroup.patch, 0004-random-seed-we-should-return-errno-of-failed-loop_wr.patch, 0005-core-cgroup-first-print-then-free.patch, OBS-URL: https://build.opensuse.org/request/show/201848 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=448
2013-10-02 13:01:24 +02:00
Index: systemd-208/src/systemctl/systemctl.c
===================================================================
--- systemd-208.orig/src/systemctl/systemctl.c
+++ systemd-208/src/systemctl/systemctl.c
@@ -6115,6 +6115,28 @@ int main(int argc, char*argv[]) {
* ellipsized. */
original_stdout_is_tty = isatty(STDOUT_FILENO);
Accepting request 149703 from home:fcrozat:branches:Base:System - Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly (bnc#798620). - Update crypt-loop-file.patch to correctly detect crypto loop files (bnc#799514). - Add journalctl-remove-leftover-message.patch: remove debug message in systemctl. - Add job-avoid-recursion-when-cancelling.patch: prevent potential recursion when cancelling a service. - Add sysctl-parse-all-keys.patch: ensure sysctl file is fully parsed. - Add journal-fix-cutoff-max-date.patch: fix computation of cutoff max date for journal. - Add reword-rescue-mode-hints.patch: reword rescue prompt. - Add improve-overflow-checks.patch: improve time overflow checks. - Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour with symlinks. - Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure hostnamectl requires an argument when called with set-hostname option. - Add agetty-overrides-term.patch: pass correctly terminal type to agetty. - Add check-for-empty-strings-in-strto-conversions.patch: better check for empty strings in strto* conversions. - Add strv-cleanup-error-path-loops.patch: cleanup strv on error path. - Add cryptsetup-handle-plain.patch: correctly handle "plain" option in cryptsetup. - Add fstab-generator-improve-error-message.patch: improve error message in fstab-generator. - Add delta-accept-t-option.patch: accept -t option in OBS-URL: https://build.opensuse.org/request/show/149703 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=331
2013-01-23 14:44:07 +01:00
2013-04-19 22:31:17 +02:00
+ if (secure_getenv("SYSTEMCTL_OPTIONS") &&
+ (!program_invocation_short_name ||
+ (program_invocation_short_name && strstr(program_invocation_short_name, "systemctl")))) {
Accepting request 149703 from home:fcrozat:branches:Base:System - Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly (bnc#798620). - Update crypt-loop-file.patch to correctly detect crypto loop files (bnc#799514). - Add journalctl-remove-leftover-message.patch: remove debug message in systemctl. - Add job-avoid-recursion-when-cancelling.patch: prevent potential recursion when cancelling a service. - Add sysctl-parse-all-keys.patch: ensure sysctl file is fully parsed. - Add journal-fix-cutoff-max-date.patch: fix computation of cutoff max date for journal. - Add reword-rescue-mode-hints.patch: reword rescue prompt. - Add improve-overflow-checks.patch: improve time overflow checks. - Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour with symlinks. - Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure hostnamectl requires an argument when called with set-hostname option. - Add agetty-overrides-term.patch: pass correctly terminal type to agetty. - Add check-for-empty-strings-in-strto-conversions.patch: better check for empty strings in strto* conversions. - Add strv-cleanup-error-path-loops.patch: cleanup strv on error path. - Add cryptsetup-handle-plain.patch: correctly handle "plain" option in cryptsetup. - Add fstab-generator-improve-error-message.patch: improve error message in fstab-generator. - Add delta-accept-t-option.patch: accept -t option in OBS-URL: https://build.opensuse.org/request/show/149703 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=331
2013-01-23 14:44:07 +01:00
+ char **parsed_systemctl_options = strv_split_quoted(getenv("SYSTEMCTL_OPTIONS"));
+
+ if (*parsed_systemctl_options && **parsed_systemctl_options) {
+ char **k,**a;
+ char **new_argv = new(char*, strv_length(argv) + strv_length(parsed_systemctl_options) + 1);
Accepting request 149703 from home:fcrozat:branches:Base:System - Add systemctl-options.patch: handle SYSTEMCTL_OPTIONS internaly (bnc#798620). - Update crypt-loop-file.patch to correctly detect crypto loop files (bnc#799514). - Add journalctl-remove-leftover-message.patch: remove debug message in systemctl. - Add job-avoid-recursion-when-cancelling.patch: prevent potential recursion when cancelling a service. - Add sysctl-parse-all-keys.patch: ensure sysctl file is fully parsed. - Add journal-fix-cutoff-max-date.patch: fix computation of cutoff max date for journal. - Add reword-rescue-mode-hints.patch: reword rescue prompt. - Add improve-overflow-checks.patch: improve time overflow checks. - Add fix-swap-behaviour-with-symlinks.patch: fix swap behaviour with symlinks. - Add hostnamectl-fix-set-hostname-with-no-argument.patch: ensure hostnamectl requires an argument when called with set-hostname option. - Add agetty-overrides-term.patch: pass correctly terminal type to agetty. - Add check-for-empty-strings-in-strto-conversions.patch: better check for empty strings in strto* conversions. - Add strv-cleanup-error-path-loops.patch: cleanup strv on error path. - Add cryptsetup-handle-plain.patch: correctly handle "plain" option in cryptsetup. - Add fstab-generator-improve-error-message.patch: improve error message in fstab-generator. - Add delta-accept-t-option.patch: accept -t option in OBS-URL: https://build.opensuse.org/request/show/149703 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=331
2013-01-23 14:44:07 +01:00
+ new_argv[0] = strdup(argv[0]);
+ for (k = new_argv+1, a = parsed_systemctl_options; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ for (a = argv+1; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ *k = NULL;
+ argv = new_argv;
+ argc = strv_length(new_argv);
+ strv_free (parsed_systemctl_options);
+ }
+ }
+
2013-04-19 22:31:17 +02:00
r = parse_argv(argc, argv);
if (r <= 0)
2013-04-19 22:31:17 +02:00
goto finish;