From aaad88a2eb3a9be24b75e36aefbea9a77b9927b4 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 17 Feb 2014 02:49:45 +0100 Subject: [PATCH] doc: choose different words to improve clarity I suggest the following changes to improve the way the text reads ("flows"). (cherry picked from commit dc968941bfc9be464e1df15afa05693dec3ec192) Conflicts: man/crypttab.xml man/sd_bus_creds_get_pid.xml man/sd_bus_message_get_monotonic_usec.xml --- man/crypttab.xml | 4 +- src/journal/systemd-journal-feeder.py | 83 +++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 src/journal/systemd-journal-feeder.py diff --git a/man/crypttab.xml b/man/crypttab.xml index 5f386e55f8..4b6d12ef4f 100644 --- a/man/crypttab.xml +++ b/man/crypttab.xml @@ -171,7 +171,7 @@ If the key slot does not match the given passphrase or key, but another would, the setup of the device will fail regardless. - This implies luks. See + This option implies luks. See cryptsetup8 for possible values. The default is to try all key slots in sequential order. @@ -275,7 +275,7 @@ tcrypt-hidden Use the hidden TrueCrypt volume. - This implies tcrypt. + This option implies tcrypt. This will map the hidden volume that is inside of the volume provided in the second diff --git a/src/journal/systemd-journal-feeder.py b/src/journal/systemd-journal-feeder.py new file mode 100644 index 0000000000..5cfab82ea0 --- /dev/null +++ b/src/journal/systemd-journal-feeder.py @@ -0,0 +1,83 @@ +import argparse +import subprocess +import collections +import struct +from systemd import journal + +options = argparse.ArgumentParser() +options.add_argument('-H', '--host', default='localhost') +options.add_argument('-p', '--port', default=19531) +options.add_argument('-b', '--boot', default='no', + action='store_const', const='yes') +options.add_argument('-f', '--follow', default='no', + action='store_const', const='yes') +options.add_argument('-s', '--submit', action='store_true') + +def spawn_curl(host, port, boot, follow): + "Spawn curl to get events from systemd-journal-gatewayd" + url = 'http://{host}:{port}/entries?follow={follow}&boot={boot}'.format( + host=host, port=port, follow=follow, boot=boot) + cmdline = ['curl', '-HAccept: application/vnd.fdo.journal', + '--silent', '--show-error', + url] + child = subprocess.Popen(cmdline, + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE) + return child + +def _read_one(inp): + fields = collections.OrderedDict() + + while inp: + line = inp.readline() + line = line[:-1] # remove newline + if not line: + break + left, split, right = line.partition(b'=') + name = left.decode('ascii') + if split: + value = right.decode() + else: + flen_ = inp.read(8) + flen = struct.unpack('