SHA256
1
0
forked from pool/systemd
systemd/handle-SYSTEMCTL_OPTIONS-environment-variable.patch
Dr. Werner Fink a6c42807cc Accepting request 172582 from home:fcrozat:branches:Base:System
- Update to release 202:
  + 'systemctl list-jobs' got some polishing. '--type=' argument
    may now be passed more than once. 'systemctl list-sockets' has
    been added.
  + systemd gained a new unit 'systemd-static-nodes.service'
    that generates static device nodes earlier during boot, and
    can run in conjunction with udev.
  + systemd-nspawn now places all containers in the new /machine
    top-level cgroup directory in the name=systemd hierarchy.
  + bootchart can now store its data in the journal.
  + journactl can now take multiple --unit= and --user-unit=
    switches.
  + The cryptsetup logic now understands the "luks.key=" kernel
    command line switch. If a configured key file is missing, it
    will fallback to prompting the user.
- Rebase some patches
- Update handle-SYSTEMCTL_OPTIONS-environment-variable.patch to
  properly handle SYSTEMCTL_OPTIONS

- Fix regression in the default for tmp auto-deletion
  (systemd-tmp-safe-defaults.patch, FATE#314974).

- Add chromebook lid switch as a power switch to logind rule to
  enable suspend on lid close

- Update to release 202:
  + 'systemctl list-jobs' got some polishing. '--type=' argument
    may now be passed more than once. 'systemctl list-sockets' has
    been added.
  + systemd gained a new unit 'systemd-static-nodes.service'

OBS-URL: https://build.opensuse.org/request/show/172582
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=365
2013-04-19 20:31:17 +00:00

43 lines
1.7 KiB
Diff

From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 22 Jan 2013 17:02:04 +0000
Subject: handle SYSTEMCTL_OPTIONS environment variable
(bnc#798620)
---
src/systemctl/systemctl.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 84ce87c..cceafc9 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5926,6 +5926,28 @@ int main(int argc, char*argv[]) {
log_parse_environment();
log_open();
+ if (secure_getenv("SYSTEMCTL_OPTIONS") &&
+ (!program_invocation_short_name ||
+ (program_invocation_short_name && strstr(program_invocation_short_name, "systemctl")))) {
+ char **parsed_systemctl_options = strv_split_quoted(getenv("SYSTEMCTL_OPTIONS"));
+
+ if (*parsed_systemctl_options && **parsed_systemctl_options) {
+ char **k,**a;
+ _cleanup_strv_free_ char **new_argv = new(char*, strv_length(argv) + strv_length(parsed_systemctl_options) + 1);
+ 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);
+ }
+ }
+
r = parse_argv(argc, argv);
if (r < 0)
goto finish;