[systemd-commits] 3 commits - src/execute.c src/manager.c src/service.c src/systemctl.c TODO
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Apr 5 17:26:04 PDT 2011
TODO | 6 ++----
src/execute.c | 2 +-
src/manager.c | 16 +++++++++-------
src/service.c | 4 ++--
src/systemctl.c | 22 +++++++++++++++++-----
5 files changed, 31 insertions(+), 19 deletions(-)
New commits:
commit 9c1b183c709b90e735b60294d7be00b37814645a
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 6 02:25:39 2011 +0200
service: fix units with more than one socket
https://bugzilla.redhat.com/show_bug.cgi?id=693289
diff --git a/TODO b/TODO
index f4aacac..f91d664 100644
--- a/TODO
+++ b/TODO
@@ -21,8 +21,6 @@ F15:
* fix alsa mixer restore to not print error when no config is stored
-* disable most systemctl verbs in chroot()s
-
Features:
* don't trim empty cgroups
diff --git a/src/execute.c b/src/execute.c
index 80c649f..d67916c 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -981,7 +981,7 @@ int exec_spawn(ExecCommand *command,
/* This string must fit in 10 chars (i.e. the length
* of "/sbin/init") */
- rename_process("sd:exec");
+ rename_process("sd.exec");
/* We reset exactly these signals, since they are the
* only ones we set to SIG_IGN in the main daemon. All
diff --git a/src/service.c b/src/service.c
index 728ca0b..a297cd9 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1592,8 +1592,8 @@ static int service_collect_fds(Service *s, int **fds, unsigned *n_fds) {
goto fail;
}
- memcpy(t, rfds, rn_fds);
- memcpy(t+rn_fds, cfds, cn_fds);
+ memcpy(t, rfds, rn_fds * sizeof(int));
+ memcpy(t+rn_fds, cfds, cn_fds * sizeof(int));
free(rfds);
free(cfds);
commit 82e23dddebc79245ccd8333f229aa37975f81b6a
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 6 01:35:56 2011 +0200
systemctl: make most operations NOPs in a chroot
diff --git a/src/systemctl.c b/src/systemctl.c
index 1507b52..eab4bf3 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -5336,11 +5336,17 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
/* Require a bus connection for all operations but
* enable/disable */
- if (!streq(verbs[i].verb, "enable") &&
- !streq(verbs[i].verb, "disable") &&
- !bus) {
- log_error("Failed to get D-Bus connection: %s", error->message);
- return -EIO;
+ if (!streq(verbs[i].verb, "enable") && !streq(verbs[i].verb, "disable")) {
+
+ if (running_in_chroot() > 0) {
+ log_info("Running in chroot, ignoring request.");
+ return 0;
+ }
+
+ if (!bus) {
+ log_error("Failed to get D-Bus connection: %s", error->message);
+ return -EIO;
+ }
}
return verbs[i].dispatch(bus, argv + optind, left);
@@ -5652,6 +5658,12 @@ int main(int argc, char*argv[]) {
goto finish;
}
+ if (running_in_chroot() > 0 && arg_action != ACTION_SYSTEMCTL) {
+ log_info("Running in chroot, ignoring request.");
+ retval = 0;
+ goto finish;
+ }
+
if (arg_transport == TRANSPORT_NORMAL)
bus_connect(arg_user ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &bus, &private_bus, &error);
else if (arg_transport == TRANSPORT_POLKIT) {
commit 67370238b55df4126e505007d46deaff8bb55a36
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 6 01:33:34 2011 +0200
manager: don't show PID for incoming signals if it is 0
diff --git a/TODO b/TODO
index f3c9b40..f4aacac 100644
--- a/TODO
+++ b/TODO
@@ -21,13 +21,13 @@ F15:
* fix alsa mixer restore to not print error when no config is stored
-* don't trim empty cgroups
- https://bugzilla.redhat.com/show_bug.cgi?id=678555
-
* disable most systemctl verbs in chroot()s
Features:
+* don't trim empty cgroups
+ https://bugzilla.redhat.com/show_bug.cgi?id=678555
+
* write blog stories about:
- chroot, nspawn and friends
- the blame game: systemd-analyze
diff --git a/src/manager.c b/src/manager.c
index 9fc854b..6ddd40e 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -2059,8 +2059,6 @@ static int manager_process_signal_fd(Manager *m) {
assert(m);
for (;;) {
- char *p = NULL;
-
if ((n = read(m->signal_watch.fd, &sfsi, sizeof(sfsi))) != sizeof(sfsi)) {
if (n >= 0)
@@ -2072,13 +2070,17 @@ static int manager_process_signal_fd(Manager *m) {
return -errno;
}
- if (sfsi.ssi_pid > 0)
+ if (sfsi.ssi_pid > 0) {
+ char *p = NULL;
+
get_process_name(sfsi.ssi_pid, &p);
- log_debug("Received SIG%s from PID %lu (%s)",
- strna(signal_to_string(sfsi.ssi_signo)),
- (unsigned long) sfsi.ssi_pid, strna(p));
- free(p);
+ log_debug("Received SIG%s from PID %lu (%s).",
+ strna(signal_to_string(sfsi.ssi_signo)),
+ (unsigned long) sfsi.ssi_pid, strna(p));
+ free(p);
+ } else
+ log_debug("Received SIG%s.", strna(signal_to_string(sfsi.ssi_signo)));
switch (sfsi.ssi_signo) {
More information about the systemd-commits
mailing list