[systemd-commits] 4 commits - src/core units/systemd-update-utmp-runlevel.service.in units/systemd-update-utmp-shutdown.service.in units/udev-settle.service.in units/udev-trigger.service.in
Lennart Poettering
lennart at kemper.freedesktop.org
Fri Apr 13 10:46:59 PDT 2012
src/core/dbus-manager.c | 18 +++++++++++++++++-
src/core/job.c | 3 ++-
units/systemd-update-utmp-runlevel.service.in | 2 +-
units/systemd-update-utmp-shutdown.service.in | 2 +-
units/udev-settle.service.in | 1 +
units/udev-trigger.service.in | 1 +
6 files changed, 23 insertions(+), 4 deletions(-)
New commits:
commit 2dad62205f3412198769f227ac4a1130f7887eec
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 13 19:45:53 2012 +0200
dbus: expose whether we have a hardware watchdog on the bus
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 46b4784..88945b5 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -242,7 +242,8 @@
" <property name=\"DefaultStandardOutput\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"DefaultStandardError\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"RuntimeWatchdogUSec\" type=\"s\" access=\"read\"/>\n" \
- " <property name=\"ShutdownWatchdogUSec\" type=\"s\" access=\"read\"/>\n"
+ " <property name=\"ShutdownWatchdogUSec\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"HaveWatchdog\" type=\"b\" access=\"read\"/>\n"
#ifdef HAVE_SYSV_COMPAT
#define BUS_MANAGER_INTERFACE_PROPERTIES_SYSV \
@@ -493,6 +494,20 @@ static int bus_manager_send_unit_files_changed(Manager *m) {
return r;
}
+static int bus_manager_append_have_watchdog(DBusMessageIter *i, const char *property, void *data) {
+ dbus_bool_t b;
+
+ assert(i);
+ assert(property);
+
+ b = access("/dev/watchdog", F_OK) >= 0;
+
+ if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
+ return -ENOMEM;
+
+ return 0;
+}
+
static const char systemd_property_string[] =
PACKAGE_STRING "\0"
DISTRIBUTION "\0"
@@ -534,6 +549,7 @@ static const BusProperty bus_manager_properties[] = {
{ "DefaultStandardError", bus_manager_append_exec_output, "s", offsetof(Manager, default_std_error) },
{ "RuntimeWatchdogUSec", bus_property_append_usec, "t", offsetof(Manager, runtime_watchdog), },
{ "ShutdownWatchdogUSec", bus_property_append_usec, "t", offsetof(Manager, shutdown_watchdog), },
+ { "HaveWatchdog", bus_manager_append_have_watchdog, "b", 0 },
#ifdef HAVE_SYSV_COMPAT
{ "SysVConsole", bus_property_append_bool, "b", offsetof(Manager, sysv_console) },
{ "SysVInitPath", bus_property_append_strv, "as", offsetof(Manager, lookup_paths.sysvinit_path), true },
commit 186b97d99fc4017d9c88221791bf8423130a9a1f
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 13 19:38:57 2012 +0200
units: drop audit reference from description of utmp units since that is build-time optional
diff --git a/units/systemd-update-utmp-runlevel.service.in b/units/systemd-update-utmp-runlevel.service.in
index 0a227cd..2a0751e 100644
--- a/units/systemd-update-utmp-runlevel.service.in
+++ b/units/systemd-update-utmp-runlevel.service.in
@@ -6,7 +6,7 @@
# (at your option) any later version.
[Unit]
-Description=Notify Audit System and Update UTMP about System Runlevel Changes
+Description=Update UTMP about System Runlevel Changes
DefaultDependencies=no
After=local-fs.target sysinit.target auditd.service runlevel1.target runlevel2.target runlevel3.target runlevel4.target runlevel5.target systemd-tmpfiles-setup.service
Before=poweroff.service reboot.service halt.service
diff --git a/units/systemd-update-utmp-shutdown.service.in b/units/systemd-update-utmp-shutdown.service.in
index 4af9212..e86c770 100644
--- a/units/systemd-update-utmp-shutdown.service.in
+++ b/units/systemd-update-utmp-shutdown.service.in
@@ -6,7 +6,7 @@
# (at your option) any later version.
[Unit]
-Description=Notify Audit System and Update UTMP about System Shutdown
+Description=Update UTMP about System Shutdown
DefaultDependencies=no
After=local-fs.target sysinit.target auditd.service systemd-update-utmp-runlevel.service
Before=poweroff.service reboot.service halt.service
commit fb316903b835d8a9e3130fa85f0cab7f7919f052
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 13 19:35:06 2012 +0200
units: add CAP_MKNOD condition to the other two udev services too
diff --git a/units/udev-settle.service.in b/units/udev-settle.service.in
index b0a4964..0a5e8c5 100644
--- a/units/udev-settle.service.in
+++ b/units/udev-settle.service.in
@@ -14,6 +14,7 @@ DefaultDependencies=no
Wants=udev.service
After=udev-trigger.service
Before=basic.target
+ConditionCapability=CAP_MKNOD
[Service]
Type=oneshot
diff --git a/units/udev-trigger.service.in b/units/udev-trigger.service.in
index cd81945..ce937ae 100644
--- a/units/udev-trigger.service.in
+++ b/units/udev-trigger.service.in
@@ -3,6 +3,7 @@ Description=udev Coldplug all Devices
Wants=udev.service
After=udev-kernel.socket udev-control.socket
DefaultDependencies=no
+ConditionCapability=CAP_MKNOD
[Service]
Type=oneshot
commit 691206668a0bf78895d4a5fe3772f4a10c790a90
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Apr 13 19:04:38 2012 +0200
unit: signal explicitly if a condition failed in unit_start()
We shouldn't print a status message on the console if we skipped a unit
due to a condition. Hence make unit_start() return -ENOEXEC in such a
case which is mapped to JOB_SKIPPED which results in no console message.
diff --git a/src/core/job.c b/src/core/job.c
index 781f83e..f3c76d6 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -417,7 +417,8 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) {
switch (result) {
case JOB_DONE:
- unit_status_printf(u, ANSI_HIGHLIGHT_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, "Started %s", unit_description(u));
+ if (u->condition_result)
+ unit_status_printf(u, ANSI_HIGHLIGHT_GREEN_ON " OK " ANSI_HIGHLIGHT_OFF, "Started %s", unit_description(u));
break;
case JOB_FAILED:
More information about the systemd-commits
mailing list