[systemd-commits] 5 commits - TODO man/sd_journal_add_match.xml man/systemd.exec.xml man/systemd.journal-fields.xml src/journal

Lennart Poettering lennart at kemper.freedesktop.org
Thu Oct 25 16:18:47 PDT 2012


 TODO                            |    4 ++++
 man/sd_journal_add_match.xml    |   12 ++++++------
 man/systemd.exec.xml            |    5 +++--
 man/systemd.journal-fields.xml  |   18 +++++++++++-------
 src/journal/sd-journal.c        |    4 ++--
 src/journal/test-journal-send.c |   17 +++++++++++++++++
 6 files changed, 43 insertions(+), 17 deletions(-)

New commits:
commit 7fb4d896e1ff018d91498f0e83b02e2534644907
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Oct 26 01:08:08 2012 +0200

    test: extend test-send to send some weirder data

diff --git a/src/journal/test-journal-send.c b/src/journal/test-journal-send.c
index 9bf42f9..3e986ed 100644
--- a/src/journal/test-journal-send.c
+++ b/src/journal/test-journal-send.c
@@ -20,6 +20,8 @@
 ***/
 
 #include <systemd/sd-journal.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 #include "log.h"
 
@@ -57,5 +59,20 @@ int main(int argc, char *argv[]) {
                         "WITH_BINARY=this is a binary value \a",
                         NULL);
 
+        syslog(LOG_NOTICE, "Hello World!");
+
+        sd_journal_print(LOG_NOTICE, "Hello World");
+
+        sd_journal_send("MESSAGE=Hello World!",
+                        "MESSAGE_ID=52fb62f99e2c49d89cfbf9d6de5e3555",
+                        "PRIORITY=5",
+                        "HOME=%s", getenv("HOME"),
+                        "TERM=%s", getenv("TERM"),
+                        "PAGE_SIZE=%li", sysconf(_SC_PAGESIZE),
+                        "N_CPUS=%li", sysconf(_SC_NPROCESSORS_ONLN),
+                        NULL);
+
+        sleep(10);
+
         return 0;
 }

commit 0f91dd8749c1a1ec308cc645269be92166413e38
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Oct 26 01:07:41 2012 +0200

    journal: properly determine cutoff max date

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 09b0eb8..d5d2d78 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -2121,7 +2121,7 @@ _public_ int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from,
                         if (from)
                                 *from = MIN(fr, *from);
                         if (to)
-                                *to = MIN(t, *to);
+                                *to = MAX(t, *to);
                 }
         }
 
@@ -2160,7 +2160,7 @@ _public_ int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, sd_id128_t boot
                         if (from)
                                 *from = MIN(fr, *from);
                         if (to)
-                                *to = MIN(t, *to);
+                                *to = MAX(t, *to);
                 }
         }
 

commit df688b23daff9382b8fa2609cfcf73315a3b896e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Oct 26 01:07:07 2012 +0200

    man: minor updates

diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index 3491d87..7b65143 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -567,8 +567,9 @@
                                 argument. If true and
                                 <varname>StandardOutput=</varname> or
                                 <varname>StandardError=</varname> are
-                                set to <option>syslog</option> or
-                                <option>kmsg</option> log lines
+                                set to <option>syslog</option>,
+                                <option>kmsg</option> or
+                                <option>journal</option>, log lines
                                 written by the executed process that
                                 are prefixed with a log level will be
                                 passed on to syslog with this log
diff --git a/man/systemd.journal-fields.xml b/man/systemd.journal-fields.xml
index d95cb01..76a436d 100644
--- a/man/systemd.journal-fields.xml
+++ b/man/systemd.journal-fields.xml
@@ -372,13 +372,17 @@
         <refsect1>
                 <title>Address Fields</title>
 
-                <para>During serialization into external formats the
-                addresses of journal entries are serialized into
-                fields prefixed with double underscores. Note that
-                these aren't proper fields when stored in the journal,
-                but addressing meta data of entries. They cannot be
-                written as part of structured log entries via calls
-                such as
+                <para>During serialization into external formats, such
+                as the <ulink
+                url="http://www.freedesktop.org/wiki/Software/systemd/export">Journal
+                Export Format</ulink> or the <ulink
+                url="http://www.freedesktop.org/wiki/Software/systemd/json">Journal
+                JSON Format</ulink>, the addresses of journal entries
+                are serialized into fields prefixed with double
+                underscores. Note that these aren't proper fields when
+                stored in the journal, but addressing meta data of
+                entries. They cannot be written as part of structured
+                log entries via calls such as
                 <citerefentry><refentrytitle>sd_journal_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>. They
                 may also not be used as matches for
                 <citerefentry><refentrytitle>sd_journal_add_match</refentrytitle><manvolnum>3</manvolnum></citerefentry></para>

commit 220369cc0c3e167af2eee8bdac95a6157e0e2b62
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Oct 26 01:06:50 2012 +0200

    update TODO

diff --git a/TODO b/TODO
index d12308e..06cfcaa 100644
--- a/TODO
+++ b/TODO
@@ -19,6 +19,10 @@ F18:
 
 Features:
 
+* introduce new "journal" group in place of adm? introduce groups for the various mini daemons?
+
+* journal: add a setgid "adm" utility to invoke from libsystemd-journal, which passes fds via STDOUT and does PK access
+
 * link up selected blog stories from man pages?
 
 * journactl: support negative filtering, i.e. FOOBAR!="waldo"

commit 0bc62352805b98cebe5debb12a5d45adfc0c66d1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Oct 26 01:06:43 2012 +0200

    man: fix example

diff --git a/man/sd_journal_add_match.xml b/man/sd_journal_add_match.xml
index f9ffc91..ad2486d 100644
--- a/man/sd_journal_add_match.xml
+++ b/man/sd_journal_add_match.xml
@@ -162,13 +162,13 @@
 
                 <programlisting>...
 int add_matches(sd_journal *j) {
-        sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service");
-        sd_journal_add_match(j, "PRIORITY=0");
-        sd_journal_add_match(j, "PRIORITY=1");
-        sd_journal_add_match(j, "PRIORITY=2");
-        sd_journal_add_match(j, "PRIORITY=3");
+        sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0);
+        sd_journal_add_match(j, "PRIORITY=0", 0);
+        sd_journal_add_match(j, "PRIORITY=1", 0);
+        sd_journal_add_match(j, "PRIORITY=2", 0);
+        sd_journal_add_match(j, "PRIORITY=3", 0);
         sd_journal_add_disjunction(j);
-        sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964");
+        sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0);
 }</programlisting>
 
         </refsect1>



More information about the systemd-commits mailing list