2013-04-13 13:09:53 +02:00
|
|
|
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(+)
|
2013-04-13 13:09:53 +02:00
|
|
|
|
Accepting request 182204 from home:fcrozat:branches:Base:System
- Update to release 205:
+ two new unit types have been introduced:
- Scope units are very similar to service units, however, are
created out of pre-existing processes -- instead of PID 1
forking off the processes.
- Slice units may be used to partition system resources in an
hierarchial fashion and then assign other units to them. By
default there are now three slices: system.slice (for all
system services), user.slice (for all user sessions),
machine.slice (for VMs and containers).
+ new concept of "transient" units, which are created at runtime
using an API and not based on configuration from disk.
+ logind has been updated to make use of scope and slice units to
manage user sessions. Logind will no longer create cgroups
hierchies itself but will relying on PID 1.
+ A new mini-daemon "systemd-machined" has been added which
may be used by virtualization managers to register local
VMs/containers. machinectl tool has been added to query
meta-data from systemd-machined.
+ Low-level cgroup configuration options ControlGroup=,
ControlGroupModify=, ControlGroupPersistent=,
ControlGroupAttribute= have been removed. High-level attribute
settings or slice units should be used instead?
+ A new bus call SetUnitProperties() has been added to alter
various runtime parameters of a unit, including cgroup
parameters. systemctl gained set-properties command to wrap
this call.
+ A new tool "systemd-run" has been added which can be used to
run arbitrary command lines as transient services or scopes,
while configuring a number of settings via the command
OBS-URL: https://build.opensuse.org/request/show/182204
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=412
2013-07-04 17:28:49 +02:00
|
|
|
Index: systemd-205/src/systemctl/systemctl.c
|
2013-06-11 13:22:32 +02:00
|
|
|
===================================================================
|
Accepting request 182204 from home:fcrozat:branches:Base:System
- Update to release 205:
+ two new unit types have been introduced:
- Scope units are very similar to service units, however, are
created out of pre-existing processes -- instead of PID 1
forking off the processes.
- Slice units may be used to partition system resources in an
hierarchial fashion and then assign other units to them. By
default there are now three slices: system.slice (for all
system services), user.slice (for all user sessions),
machine.slice (for VMs and containers).
+ new concept of "transient" units, which are created at runtime
using an API and not based on configuration from disk.
+ logind has been updated to make use of scope and slice units to
manage user sessions. Logind will no longer create cgroups
hierchies itself but will relying on PID 1.
+ A new mini-daemon "systemd-machined" has been added which
may be used by virtualization managers to register local
VMs/containers. machinectl tool has been added to query
meta-data from systemd-machined.
+ Low-level cgroup configuration options ControlGroup=,
ControlGroupModify=, ControlGroupPersistent=,
ControlGroupAttribute= have been removed. High-level attribute
settings or slice units should be used instead?
+ A new bus call SetUnitProperties() has been added to alter
various runtime parameters of a unit, including cgroup
parameters. systemctl gained set-properties command to wrap
this call.
+ A new tool "systemd-run" has been added which can be used to
run arbitrary command lines as transient services or scopes,
while configuring a number of settings via the command
OBS-URL: https://build.opensuse.org/request/show/182204
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=412
2013-07-04 17:28:49 +02:00
|
|
|
--- systemd-205.orig/src/systemctl/systemctl.c
|
|
|
|
+++ systemd-205/src/systemctl/systemctl.c
|
|
|
|
@@ -6131,6 +6131,28 @@ int main(int argc, char*argv[]) {
|
2013-04-19 22:31:17 +02:00
|
|
|
log_parse_environment();
|
|
|
|
log_open();
|
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")))) {
|
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;
|
2013-05-15 16:09:16 +02:00
|
|
|
+ char **new_argv = new(char*, strv_length(argv) + strv_length(parsed_systemctl_options) + 1);
|
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)
|
|
|
|
goto finish;
|