[systemd-commits] 2 commits - man/journalctl.xml src/core src/journal

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon Oct 7 20:46:13 PDT 2013


 man/journalctl.xml       |   15 ++++++++++++---
 src/core/service.c       |   11 +++++++++++
 src/journal/journalctl.c |   12 +++++++++---
 3 files changed, 32 insertions(+), 6 deletions(-)

New commits:
commit 6aca9a587d4ad40b1c044f99e3714022201b9fd4
Author: Sylvia Else <sylviabz1 at cryogenic.net>
Date:   Sun Oct 6 23:06:35 2013 -0400

    systemd: serialize/deserialize forbid_restart value
    
    The Service type's forbid_restart field was not preserved by
    serialization/deserialization, so the fact that the service should not
    be restarted after stopping was lost.
    
    If a systemctl stop foo command has been given, but the foo service
    has not yet stopped, and then the systemctl --system daemon-reload was
    given, then when the foo service eventually stopped, systemd would
    restart it.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=69800

diff --git a/src/core/service.c b/src/core/service.c
index 6792024..98b1599 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2651,6 +2651,9 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
         if (s->exec_context.var_tmp_dir)
                 unit_serialize_item(u, f, "var-tmp-dir", s->exec_context.var_tmp_dir);
 
+        if (s->forbid_restart)
+                unit_serialize_item(u, f, "forbid_restart", yes_no(s->forbid_restart));
+
         return 0;
 }
 
@@ -2787,6 +2790,14 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
                         return log_oom();
 
                 s->exec_context.var_tmp_dir = t;
+        } else if (streq(key, "forbid_restart")) {
+                int b;
+
+                b = parse_boolean(value);
+                if (b < 0)
+                        log_debug_unit(u->id, "Failed to parse forbid_restart value %s", value);
+                else
+                        s->forbid_restart = b;
         } else
                 log_debug_unit(u->id, "Unknown serialization key '%s'", key);
 

commit 2b8f6883a17b9386299b7690869ccd8e20fe0347
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Oct 6 21:55:18 2013 -0400

    journalctl: flip to --full by default
    
    We already shew lines in full when using a pager or not on a
    tty. The commit disables ellipsization in the sole remaining case,
    namely when --follow is used.
    
    This has been a popular request for a long time, and indeed, full
    output seems much more useful. Old behaviour can still be requested by
    using --no-full. Old options retain their behaviour for compatiblity,
    but aren't advertised as much. This change applies only to jornalctl,
    not to systemctl, when ellipsization is useful to keep the layout.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=984758

diff --git a/man/journalctl.xml b/man/journalctl.xml
index b5a0c53..2ce81a0 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -152,11 +152,20 @@
                         </varlistentry>
 
                         <varlistentry>
-                                <term><option>-l</option></term>
+                                <term><option>--no-full</option></term>
                                 <term><option>--full</option></term>
+                                <term><option>-l</option></term>
+
+                                <listitem><para>Ellipsize fields when
+                                they don't fit in available columns.
+                                The default is to show full fields,
+                                allowing them to wrap or be truncated
+                                by the pager if one is used.</para>
 
-                                <listitem><para>Show all (printable) fields in
-                                full.</para></listitem>
+                                <para>Old options
+                                <option>-l</option>/<option>--full</option>
+                                not useful anymore, except to undo
+                                <option>--no-full</option>.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 9a2d255..2f8be1b 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -64,7 +64,7 @@
 static OutputMode arg_output = OUTPUT_SHORT;
 static bool arg_pager_end = false;
 static bool arg_follow = false;
-static bool arg_full = false;
+static bool arg_full = true;
 static bool arg_all = false;
 static bool arg_no_pager = false;
 static int arg_lines = -1;
@@ -138,7 +138,7 @@ static int help(void) {
                "                           short-precise, short-monotonic, verbose,\n"
                "                           export, json, json-pretty, json-sse, cat)\n"
                "  -x --catalog             Add message explanations where available\n"
-               "  -l --full                Do not ellipsize fields\n"
+               "     --no-full             Ellipsize fields\n"
                "  -a --all                 Show all fields, including long and unprintable\n"
                "  -q --quiet               Don't show privilege warning\n"
                "     --no-pager            Do not pipe output into a pager\n"
@@ -175,6 +175,7 @@ static int parse_argv(int argc, char *argv[]) {
         enum {
                 ARG_VERSION = 0x100,
                 ARG_NO_PAGER,
+                ARG_NO_FULL,
                 ARG_NO_TAIL,
                 ARG_NEW_ID128,
                 ARG_USER,
@@ -208,6 +209,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "output",         required_argument, NULL, 'o'                },
                 { "all",            no_argument,       NULL, 'a'                },
                 { "full",           no_argument,       NULL, 'l'                },
+                { "no-full",        no_argument,       NULL, ARG_NO_FULL        },
                 { "lines",          optional_argument, NULL, 'n'                },
                 { "no-tail",        no_argument,       NULL, ARG_NO_TAIL        },
                 { "new-id128",      no_argument,       NULL, ARG_NEW_ID128      },
@@ -298,6 +300,10 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_full = true;
                         break;
 
+                case ARG_NO_FULL:
+                        arg_full = false;
+                        break;
+
                 case 'a':
                         arg_all = true;
                         break;
@@ -1622,7 +1628,7 @@ int main(int argc, char *argv[]) {
 
                         flags =
                                 arg_all * OUTPUT_SHOW_ALL |
-                                (arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
+                                arg_full * OUTPUT_FULL_WIDTH |
                                 on_tty() * OUTPUT_COLOR |
                                 arg_catalog * OUTPUT_CATALOG;
 



More information about the systemd-commits mailing list