Re: [systemd-devel] [PATCH] units: cleanup agetty command line

2013-06-05 Thread Colin Guthrie
'Twas brillig, and Lennart Poettering at 04/06/13 14:41 did gyre and gimble:
> On Mon, 03.06.13 14:28, Karel Zak (k...@redhat.com) wrote:
> 
>>  * baud rate is optional and unnecessary for virtual terminals
>>  * term type is optional (default is 'linux' for virtual terminals
>>and 'vt102' for serial lines)
>>  * long options are more user-friendly
>>
>> ... all this is supported since util-linux v2.20 (Aug 2011).
> 
> Applied! Thanks.

Aww, pity the util-linux version wasn't corrected first to v2.23 first.
Ahh well as long as people remember... :)

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v3] journalctl: Add support for showing messages from a previous boot

2013-06-05 Thread Jan Janssen
Unfortunately, to get a chronological list of boot IDs, we
need to search through the journal. sd_journal_enumerate_unique()
doesn't help us here, because order of returned values is undefined.

An initial search for the reference boot ID is performed. We then
start a search filtering by SD_MESSAGE_JOURNAL_START. This
message ID should come up in every journal and is therefore a good
start to reduce the amount of messages the lookup process has to
walk through to find the previous/next boot IDs.

Note that this or any other message ID could get rotated away,
so lookup is not guaranteed to be precise. This should only affect
old (and uninteresting) journal entries, though.
---
Changes in v3:
  - do filter by MESSAGE_ID and simply declare the cases where we
skip boot IDs not a problem
  - --this-boot not documented anymore
  - usage of ":" instead of "^" to define relative IDs
  - improved wording in the man page
  - indentation fixes

Changes in v2:
  - prevent unnecessary strdup by changing the argv value in place
  - speed up the lookup by doing an initial search for the boot ID

 TODO |   1 -
 man/journalctl.xml   |  58 +---
 shell-completion/bash/journalctl |   8 +-
 src/journal/journalctl.c | 186 ---
 4 files changed, 228 insertions(+), 25 deletions(-)

diff --git a/TODO b/TODO
index ecc5748..2b2aafc 100644
--- a/TODO
+++ b/TODO
@@ -259,7 +259,6 @@ Features:
   - journal-send.c, log.c: when the log socket is clogged, and we drop, count 
this and write a message about this when it gets unclogged again.
   - journal: find a way to allow dropping history early, based on priority, 
other rules
   - journal: When used on NFS, check payload hashes
-  - Introduce journalctl -b  to show journal messages of a previous boot
   - journald: check whether it is OK if the client can still modify delivered 
journal entries
   - journal live copy, based on libneon (client) and libmicrohttpd (server)
   - journald: add kernel cmdline option to disable ratelimiting for debug 
purposes
diff --git a/man/journalctl.xml b/man/journalctl.xml
index d9ca0a6..6cbeb22 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -312,23 +312,55 @@
 
 
 
--b
---this-boot
-
-Show data only from
-current boot. This will add a match
-for _BOOT_ID= for
-the current boot ID of the
-kernel.
+-b 
ID
+
--boot=ID
+
+Show messages from specified
+boot ID. This will
+add a match for 
_BOOT_ID=.
+
+The argument is a 128 bit ID given in
+short or UUID form and optionally followed by
+:n which identifies the nth
+boot relative to the boot ID given to the left
+of :. Supplying a negative
+value will look for a past boot and a positive
+value for a future boot. The boot IDs are
+searched for in chronological order.
+
+If no number is provided after
+:, -1 is
+assumed. A value of 0 is valid and equivalent 
to
+omitting :0. The boot ID may
+be omitted if : is provided,
+which will assume the current boot ID as the
+reference.
+
+For example, if 
962e0810b0c44735a6a70e7132996502
+were the ID of the current boot, the following
+are all equivalent:
+
962e0810b0c44735a6a70e7132996502,
+
962e0810-b0c4-4735-a6a7-0e7132996502,
+:0,
+
962e0810b0c44735a6a70e7132996502:0,
+
962e0810-b0c4-4735-a6a7-0e7132996502:0.
+Additionally, if 
04089164-6fb3-4826-a7d1-207b11a02169
+were the previous boot ID the following are 
equivalent:
+
040891646fb34826a7d1207b11a02169,
+
04089164-6fb3-4826-a7d1-207b11a02169,
+:-1, :,
+
962e0810b0c44735a6a70e7132996502:-1,
+
962e0810-b0c4-4735-a6a7-0e7132996502:-1.
+  

Re: [systemd-devel] shell / systemd config files

2013-06-05 Thread Lennart Poettering
On Mon, 20.05.13 10:28, James Buren (r...@ymail.com) wrote:

> Files such as /etc/machine-info have an incompatibility with systemd in 
> regards to how
> it writes and/or parses them. Take the following sample:
> 
> PRETTY_HOSTNAME="\'\"\$\`\\"
> 
> Systemd will translate this to: '"$`\
> However, the shells bash and dash will translate this to: \'"$`\
> 
> So, it appears to be that systemd is escaping single quotes when the shells 
> themselves
> do not honor it for single quotes here. Thoughts for a solution? I ask 
> because I have to
> write some systemd config files for a distro installer, and cannot use 
> hostnamectl yet.

Hmm, so let me see if I grok this. Bourne shells convert \' inside ""
quotes into \' while systemd converts it to '. Correct?

If that's the case we probably something we should fix. However, to do
that I'd first need to understand the full logic here. For example, what
do bourne shells translate an unknown backslash-escaped sequence to? In
systemd we generally translate this to the same string, but with the \
dropped. The shell appears to simply map it to the exact same string,
with the \ included. 

I guess we should do what we should have done in the first place: find
some docs about the precise Bourne shell escaping rules and reimplement
that. Anyone has some good docs?

James, can you please file a bug on rhbz or fdobz about this?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] [Fix] Do not handle SIGKILL since we can not

2013-06-05 Thread Lennart Poettering
On Mon, 20.05.13 15:22, Chengwei Yang (chengwei.y...@intel.com) wrote:

> This is a minor fix because it's not a major issue, this fix just avoid
> to get EINVAL error from sigaction(2).

Thanks, applied!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel