[systemd-commits] 3 commits - src/cgroups-agent.c src/dbus-common.c src/execute.c src/systemctl.c units/arch units/emergency.service units/fedora units/gentoo units/session units/suse
Lennart Poettering
lennart at kemper.freedesktop.org
Sat Jul 10 19:38:47 PDT 2010
src/cgroups-agent.c | 6 ++++--
src/dbus-common.c | 2 +-
src/execute.c | 2 +-
src/systemctl.c | 20 ++++++++++++++------
units/arch/halt.service | 2 +-
units/arch/poweroff.service | 2 +-
units/arch/reboot.service | 2 +-
units/emergency.service | 2 +-
units/fedora/halt.service | 2 +-
units/fedora/poweroff.service | 2 +-
units/fedora/reboot.service | 2 +-
units/gentoo/halt.service | 2 +-
units/gentoo/poweroff.service | 2 +-
units/gentoo/reboot.service | 2 +-
units/session/exit.service.in | 2 +-
units/suse/halt.service | 2 +-
units/suse/poweroff.service | 2 +-
units/suse/reboot.service | 2 +-
18 files changed, 34 insertions(+), 24 deletions(-)
New commits:
commit b5f776cee9afc14e6c4b945be0576ab3b27e33b7
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Jul 11 04:38:40 2010 +0200
execute: use right logger socket
diff --git a/src/execute.c b/src/execute.c
index 0c2526b..6363719 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -171,7 +171,7 @@ static int connect_logger_as(const ExecContext *context, ExecOutput output, cons
sa.sa.sa_family = AF_UNIX;
strncpy(sa.un.sun_path+1, LOGGER_SOCKET, sizeof(sa.un.sun_path)-1);
- if (connect(fd, &sa.sa, sizeof(sa)) < 0) {
+ if (connect(fd, &sa.sa, sizeof(sa_family_t) + 1 + sizeof(LOGGER_SOCKET) - 1) < 0) {
close_nointr_nofail(fd);
return -errno;
}
commit 983d9c90151f4b85301bd8078afd560269e75961
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Jul 11 04:22:00 2010 +0200
units: turn Wants=shutdown back into Requires=shutdown to avoid removal of jobs due to the impact minimizer
diff --git a/src/systemctl.c b/src/systemctl.c
index d033a75..d1892e4 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -794,12 +794,17 @@ finish:
}
static int start_special(DBusConnection *bus, char **args, unsigned n) {
+ int r;
+
assert(bus);
assert(args);
- warn_wall(verb_to_action(args[0]));
+ r = start_unit(bus, args, n);
+
+ if (r >= 0)
+ warn_wall(verb_to_action(args[0]));
- return start_unit(bus, args, n);
+ return r;
}
static int check_unit(DBusConnection *bus, char **args, unsigned n) {
@@ -3292,26 +3297,29 @@ static int reload_with_fallback(DBusConnection *bus) {
static int start_with_fallback(DBusConnection *bus) {
int r;
- warn_wall(arg_action);
if (bus) {
/* First, try systemd via D-Bus. */
if ((r = start_unit(bus, NULL, 0)) > 0)
- return 0;
+ goto done;
/* Hmm, talking to systemd via D-Bus didn't work. Then
* let's try to talk to Upstart via D-Bus. */
if ((r = talk_upstart()) > 0)
- return 0;
+ goto done;
}
/* Nothing else worked, so let's try
* /dev/initctl */
if ((r = talk_initctl()) != 0)
- return 0;
+ goto done;
log_error("Failed to talk to init daemon.");
return -EIO;
+
+done:
+ warn_wall(arg_action);
+ return 0;
}
static int halt_main(DBusConnection *bus) {
diff --git a/units/arch/halt.service b/units/arch/halt.service
index 190e4fe..87224e3 100644
--- a/units/arch/halt.service
+++ b/units/arch/halt.service
@@ -8,7 +8,7 @@
[Unit]
Description=Halt
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/arch/poweroff.service b/units/arch/poweroff.service
index 0b1ee89..ffa592c 100644
--- a/units/arch/poweroff.service
+++ b/units/arch/poweroff.service
@@ -8,7 +8,7 @@
[Unit]
Description=Power-Off
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/arch/reboot.service b/units/arch/reboot.service
index 274f407..934903d 100644
--- a/units/arch/reboot.service
+++ b/units/arch/reboot.service
@@ -8,7 +8,7 @@
[Unit]
Description=Reboot
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/emergency.service b/units/emergency.service
index 0014c26..bcedebf 100644
--- a/units/emergency.service
+++ b/units/emergency.service
@@ -10,7 +10,7 @@
[Unit]
Description=Emergency Shell
DefaultDependencies=no
-Wants=shutdown.target umount.target
+Requires=shutdown.target umount.target
After=shutdown.target umount.target
[Service]
diff --git a/units/fedora/halt.service b/units/fedora/halt.service
index 0c0fa5f..b957a3f 100644
--- a/units/fedora/halt.service
+++ b/units/fedora/halt.service
@@ -8,7 +8,7 @@
[Unit]
Description=Halt
DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
After=shutdown.target killall.service
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/fedora/poweroff.service b/units/fedora/poweroff.service
index 913edc4..76d030c 100644
--- a/units/fedora/poweroff.service
+++ b/units/fedora/poweroff.service
@@ -8,7 +8,7 @@
[Unit]
Description=Power-Off
DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
After=shutdown.target killall.service
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/fedora/reboot.service b/units/fedora/reboot.service
index c81b13e..6a93c0b 100644
--- a/units/fedora/reboot.service
+++ b/units/fedora/reboot.service
@@ -8,7 +8,7 @@
[Unit]
Description=Reboot
DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
After=shutdown.target killall.service
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/gentoo/halt.service b/units/gentoo/halt.service
index 28db813..19ead8a 100644
--- a/units/gentoo/halt.service
+++ b/units/gentoo/halt.service
@@ -8,7 +8,7 @@
[Unit]
Description=Halt
DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
After=shutdown.target killall.service
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/gentoo/poweroff.service b/units/gentoo/poweroff.service
index da6f48f..9ceb205 100644
--- a/units/gentoo/poweroff.service
+++ b/units/gentoo/poweroff.service
@@ -8,7 +8,7 @@
[Unit]
Description=Power-Off
DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
After=shutdown.target killall.service
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/gentoo/reboot.service b/units/gentoo/reboot.service
index a0f3575..c223e6c 100644
--- a/units/gentoo/reboot.service
+++ b/units/gentoo/reboot.service
@@ -8,7 +8,7 @@
[Unit]
Description=Reboot
DefaultDependencies=no
-Wants=shutdown.target killall.service
+Requires=shutdown.target killall.service
After=shutdown.target killall.service
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/session/exit.service.in b/units/session/exit.service.in
index 3e5b5bf..1f515a7 100644
--- a/units/session/exit.service.in
+++ b/units/session/exit.service.in
@@ -1,7 +1,7 @@
[Unit]
Description=Exit
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
[Service]
diff --git a/units/suse/halt.service b/units/suse/halt.service
index 00bbfa9..5f42ac6 100644
--- a/units/suse/halt.service
+++ b/units/suse/halt.service
@@ -8,7 +8,7 @@
[Unit]
Description=Halt
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/suse/poweroff.service b/units/suse/poweroff.service
index e9aff27..93a9da5 100644
--- a/units/suse/poweroff.service
+++ b/units/suse/poweroff.service
@@ -8,7 +8,7 @@
[Unit]
Description=Power-Off
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
diff --git a/units/suse/reboot.service b/units/suse/reboot.service
index e9b76b6..c3526b3 100644
--- a/units/suse/reboot.service
+++ b/units/suse/reboot.service
@@ -8,7 +8,7 @@
[Unit]
Description=Reboot
DefaultDependencies=no
-Wants=shutdown.target
+Requires=shutdown.target
After=shutdown.target
Conflicts=dev-hugepages.automount dev-mqueue.automount proc-sys-fs-binfmt_misc.automount sys-kernel-debug.automount sys-kernel-security.automount
commit 51bc5d4b84ba684463ea6e335a1d761d14aa76d8
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Jul 11 04:10:28 2010 +0200
dbus: get rid of last non-private busses
diff --git a/src/cgroups-agent.c b/src/cgroups-agent.c
index 232b63e..d3db151 100644
--- a/src/cgroups-agent.c
+++ b/src/cgroups-agent.c
@@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
- if (!(bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error))) {
+ if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) {
log_error("Failed to get D-Bus connection: %s", error.message);
goto finish;
}
@@ -61,8 +61,10 @@ int main(int argc, char *argv[]) {
r = 0;
finish:
- if (bus)
+ if (bus) {
+ dbus_connection_close(bus);
dbus_connection_unref(bus);
+ }
if (m)
dbus_message_unref(m);
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 267ab26..127da23 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -76,7 +76,7 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private, DBusError *
*private = true;
} else {
- if (!(bus = dbus_bus_get(t, error)))
+ if (!(bus = dbus_bus_get_private(t, error)))
return -EIO;
if (private)
More information about the systemd-commits
mailing list