[systemd-commits] 6 commits - Makefile.am Makefile-man.am man/coredumpctl.xml README src/core src/readahead TODO

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sun Jun 22 12:32:39 PDT 2014


 Makefile-man.am                  |    6 +++--
 Makefile.am                      |    3 ++
 README                           |    1 
 TODO                             |    6 -----
 man/coredumpctl.xml              |    6 +++++
 src/core/snapshot.c              |   19 ++++++++++------
 src/core/transaction.c           |   45 +++++++++++++++++++++++++--------------
 src/readahead/readahead-common.c |    4 ++-
 8 files changed, 58 insertions(+), 32 deletions(-)

New commits:
commit a900b827d4d67f4961d2e4ed48d73e6bc1d6b4b6
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:52:43 2014 -0400

    README: add gobject-introspection

diff --git a/README b/README
index 2fd95e9..19a4478 100644
--- a/README
+++ b/README
@@ -121,6 +121,7 @@ REQUIREMENTS:
         libqrencode (optional)
         libmicrohttpd (optional)
         libpython (optional)
+        gobject-introspection > 1.40.0 (optional)
         make, gcc, and similar tools
 
         During runtime, you need the following additional

commit 6f8bd5c94ebc19c9afdb17684945526dddc2ec23
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:20:08 2014 -0400

    core/snapshot: log info when snapshots are created and removed
    
    Snapshot mechanism is not used very much, but snapshot creation/destruction
    should be at least as verbose as normal unit starting/stopping.

diff --git a/TODO b/TODO
index 09d8bd3..a928c81 100644
--- a/TODO
+++ b/TODO
@@ -214,8 +214,6 @@ Features:
   - add 'set -e' to scripts in test/
   - make stuff in test/ work with separate output dir
 
-* systemctl delete x.snapshot leaves no trace in logs (at least at default level).
-
 * seems that when we follow symlinks to units we prefer the symlink
   destination path over /etc and /usr. We should not do that. Instead
   /etc should always override /run+/usr and also any symlink
diff --git a/src/core/snapshot.c b/src/core/snapshot.c
index d914af2..5eed615 100644
--- a/src/core/snapshot.c
+++ b/src/core/snapshot.c
@@ -51,10 +51,11 @@ static void snapshot_set_state(Snapshot *s, SnapshotState state) {
         s->state = state;
 
         if (state != old_state)
-                log_debug("%s changed %s -> %s",
-                          UNIT(s)->id,
-                          snapshot_state_to_string(old_state),
-                          snapshot_state_to_string(state));
+                log_debug_unit(UNIT(s)->id,
+                               "%s changed %s -> %s",
+                               UNIT(s)->id,
+                               snapshot_state_to_string(old_state),
+                               snapshot_state_to_string(state));
 
         unit_notify(UNIT(s), state_translation_table[old_state], state_translation_table[state], true);
 }
@@ -154,7 +155,7 @@ static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
 
                 state = snapshot_state_from_string(value);
                 if (state < 0)
-                        log_debug("Failed to parse state value %s", value);
+                        log_debug_unit(u->id, "Failed to parse state value %s", value);
                 else
                         s->deserialized_state = state;
 
@@ -162,7 +163,7 @@ static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
 
                 r = parse_boolean(value);
                 if (r < 0)
-                        log_debug("Failed to parse cleanup value %s", value);
+                        log_debug_unit(u->id, "Failed to parse cleanup value %s", value);
                 else
                         s->cleanup = r;
 
@@ -172,7 +173,7 @@ static int snapshot_deserialize_item(Unit *u, const char *key, const char *value
                 if (r < 0)
                         return r;
         } else
-                log_debug("Unknown serialization key '%s'", key);
+                log_debug_unit(u->id, "Unknown serialization key '%s'", key);
 
         return 0;
 }
@@ -257,6 +258,8 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_error *e,
         SNAPSHOT(u)->cleanup = cleanup;
         *_s = SNAPSHOT(u);
 
+        log_info_unit(u->id, "Created snapshot %s.", u->id);
+
         return 0;
 
 fail:
@@ -269,6 +272,8 @@ fail:
 void snapshot_remove(Snapshot *s) {
         assert(s);
 
+        log_info_unit(UNIT(s)->id, "Removing snapshot %s.", UNIT(s)->id);
+
         unit_add_to_cleanup_queue(UNIT(s));
 }
 

commit 04ef5b03f64d3824a51a2a903548af029a006744
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:04:23 2014 -0400

    core/transaction: avoid misleading error message when unit not found
    
    There's no point in telling the user to look at the logs when
    an attempt to load the unit file failed with ENOENT.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=996133

diff --git a/TODO b/TODO
index ff065bf..09d8bd3 100644
--- a/TODO
+++ b/TODO
@@ -15,10 +15,6 @@ Bugfixes:
 
 * properly handle .mount unit state tracking when two mount points are stacked one on top of another on the exact same mount point.
 
-* shorten the message to sane length:
-  "Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service
-  failed to load: No such file or directory. See system logs and 'systemctl status display-manager.service' for details."
-
 * sd_bus_unref() is broken regarding self-references and "pseudo thread-safety".
   See the comment in sd_bus_unref() for more..
 
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 9fb6101..d23a45c 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -870,12 +870,18 @@ int transaction_add_job_and_dependencies(
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
-                sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
-                                  "Unit %s failed to load: %s. "
-                                  "See system logs and 'systemctl status %s' for details.",
-                                  unit->id,
-                                  strerror(-unit->load_error),
-                                  unit->id);
+                if (unit->load_error == -ENOENT)
+                        sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
+                                          "Unit %s failed to load: %s.",
+                                          unit->id,
+                                          strerror(-unit->load_error));
+                else
+                        sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
+                                          "Unit %s failed to load: %s. "
+                                          "See system logs and 'systemctl status %s' for details.",
+                                          unit->id,
+                                          strerror(-unit->load_error),
+                                          unit->id);
                 return -EINVAL;
         }
 

commit 9ba6c18532b4da96ae6916865c3db44054c2af6b
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 14:00:36 2014 -0400

    core/transaction: reindent and split very long lines

diff --git a/src/core/transaction.c b/src/core/transaction.c
index d00f427..9fb6101 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -264,9 +264,12 @@ static int transaction_merge_jobs(Transaction *tr, sd_bus_error *e) {
                                 return -EAGAIN;
 
                         /* We couldn't merge anything. Failure */
-                        sd_bus_error_setf(
-                                        e, BUS_ERROR_TRANSACTION_JOBS_CONFLICTING, "Transaction contains conflicting jobs '%s' and '%s' for %s. Probably contradicting requirement dependencies configured.",
-                                        job_type_to_string(t), job_type_to_string(k->type), k->unit->id);
+                        sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_JOBS_CONFLICTING,
+                                          "Transaction contains conflicting jobs '%s' and '%s' for %s. "
+                                          "Probably contradicting requirement dependencies configured.",
+                                          job_type_to_string(t),
+                                          job_type_to_string(k->type),
+                                          k->unit->id);
                         return r;
                 }
         }
@@ -512,7 +515,8 @@ static int transaction_is_destructive(Transaction *tr, JobMode mode, sd_bus_erro
                 if (j->unit->job && (mode == JOB_FAIL || j->unit->job->irreversible) &&
                     !job_type_is_superset(j->type, j->unit->job->type)) {
 
-                        sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE, "Transaction is destructive.");
+                        sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE,
+                                          "Transaction is destructive.");
                         return -EEXIST;
                 }
         }
@@ -860,35 +864,38 @@ int transaction_add_job_and_dependencies(
             unit->load_state != UNIT_ERROR &&
             unit->load_state != UNIT_NOT_FOUND &&
             unit->load_state != UNIT_MASKED) {
-                sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->id);
+                sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
+                                  "Unit %s is not loaded properly.", unit->id);
                 return -EINVAL;
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
                 sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
-                               "Unit %s failed to load: %s. "
-                               "See system logs and 'systemctl status %s' for details.",
-                               unit->id,
-                               strerror(-unit->load_error),
-                               unit->id);
+                                  "Unit %s failed to load: %s. "
+                                  "See system logs and 'systemctl status %s' for details.",
+                                  unit->id,
+                                  strerror(-unit->load_error),
+                                  unit->id);
                 return -EINVAL;
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_NOT_FOUND) {
                 sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
-                               "Unit %s failed to load: %s.",
-                               unit->id,
-                               strerror(-unit->load_error));
+                                  "Unit %s failed to load: %s.",
+                                  unit->id, strerror(-unit->load_error));
                 return -EINVAL;
         }
 
         if (type != JOB_STOP && unit->load_state == UNIT_MASKED) {
-                sd_bus_error_setf(e, BUS_ERROR_UNIT_MASKED, "Unit %s is masked.", unit->id);
+                sd_bus_error_setf(e, BUS_ERROR_UNIT_MASKED,
+                                  "Unit %s is masked.", unit->id);
                 return -EADDRNOTAVAIL;
         }
 
         if (!unit_job_is_applicable(unit, type)) {
-                sd_bus_error_setf(e, BUS_ERROR_JOB_TYPE_NOT_APPLICABLE, "Job type %s is not applicable for unit %s.", job_type_to_string(type), unit->id);
+                sd_bus_error_setf(e, BUS_ERROR_JOB_TYPE_NOT_APPLICABLE,
+                                  "Job type %s is not applicable for unit %s.",
+                                  job_type_to_string(type), unit->id);
                 return -EBADR;
         }
 

commit dfdd0e0730385eef08f019863fd41168b05b6ab0
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 13:38:48 2014 -0400

    Add systemd-coredumpctl as an alias for coredumpctl
    
    Should make the transition easier for exisiting users.

diff --git a/Makefile-man.am b/Makefile-man.am
index 1e4ec67..edea4c3 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -666,8 +666,10 @@ if ENABLE_COREDUMP
 MANPAGES += \
 	man/coredumpctl.1
 MANPAGES_ALIAS += \
-	#
-
+	man/systemd-coredumpctl.1
+man/systemd-coredumpctl.1: man/coredumpctl.1
+man/systemd-coredumpctl.html: man/coredumpctl.html
+	$(html-alias)
 
 endif
 
diff --git a/Makefile.am b/Makefile.am
index 8fe7cbe..20b6082 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3794,6 +3794,9 @@ dist_bashcompletion_DATA += \
 dist_zshcompletion_DATA += \
 	shell-completion/zsh/_coredumpctl
 
+GENERAL_ALIASES += \
+	$(bindir)/coredumpctl $(bindir)/systemd-coredumpctl
+
 sysctl_DATA = \
 	sysctl.d/50-coredump.conf
 
diff --git a/man/coredumpctl.xml b/man/coredumpctl.xml
index 5ea865e..0cd3fe5 100644
--- a/man/coredumpctl.xml
+++ b/man/coredumpctl.xml
@@ -45,6 +45,8 @@
 
         <refnamediv>
                 <refname>coredumpctl</refname>
+                <refname>systemd-coredumpctl</refname>
+
                 <refpurpose>Retrieve coredumps from the journal</refpurpose>
         </refnamediv>
 
@@ -63,6 +65,10 @@
                 <para><command>coredumpctl</command> may be used to
                 retrieve coredumps from
                 <citerefentry><refentrytitle>systemd-journald</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+
+                <para><command>systemd-coredumpctl</command> is a
+                depracated alias for
+                <command>coredumpctl</command>.</para>
         </refsect1>
 
         <refsect1>

commit bfff8f072d4ddbf0410aae80c62cd6ee5ebc0701
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jun 22 13:21:47 2014 -0400

    readahead: avoid gcc warning about format
    
    src/readahead/readahead-common.c:55:17: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 7 has type ‘__off64_t’ [-Wformat=]
                     log_debug("Not preloading file %s with size out of bounds %zu", fn, st->st_size);
                     ^

diff --git a/src/readahead/readahead-common.c b/src/readahead/readahead-common.c
index eda99e8..3ca48a7 100644
--- a/src/readahead/readahead-common.c
+++ b/src/readahead/readahead-common.c
@@ -52,7 +52,9 @@ int file_verify(int fd, const char *fn, off_t file_size_max, struct stat *st) {
         }
 
         if (st->st_size <= 0 || st->st_size > file_size_max) {
-                log_debug("Not preloading file %s with size out of bounds %zu", fn, st->st_size);
+                assert_cc(sizeof(st->st_size) == 8);
+                log_debug("Not preloading file %s with size out of bounds %"PRIu64,
+                          fn, st->st_size);
                 return 0;
         }
 



More information about the systemd-commits mailing list