Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Questions about systemd logging
Date: Wed, 09 Jan 2013 17:50:22
Message-Id: CADPrc814sO0DR44ZfqwPPez4kAHMsBJhfu=AwqdqApAshdL4kQ@mail.gmail.com
In Reply to: [gentoo-user] Questions about systemd logging by Robin Atwood
1 On Wed, Jan 9, 2013 at 5:12 AM, Robin Atwood <robin.atwood@×××××××××.net> wrote:
2 > I have temporarily shelved my problem with mounting since my work-around
3 > seems adequate. But I have some questions about logging. Journald works fine
4 > but what am I supposed to see on the main console?
5
6 What do you mean by "main console"? tty1? tty12? /dev/console?
7
8 > All I can see is a few
9 > kernel messages which cease after the lvm service completes. There are no
10 > service starting messages and no login prompt appears. The other ttys have a
11 > banner and prompt as usual.
12
13 systemd by default only spawns 1 (one) tty, tty1:
14
15 $ ls /etc/systemd/system/getty.target.wants/
16 getty@××××.service
17
18 That's the only login prompt spawned by default. The other virtual
19 consoles get spawned automatically if you switch to them. In other
20 words, if you never switch to the virtual console 2, there is no login
21 prompt there. It will appear until you switch to it. systemd should
22 switch to tty1 and launch getty@××××.service automatically when the
23 getty.target is reached in the boot process.
24
25 I'm not really sure what the problem is; if you are concerned by the
26 "[ OK ]" messages when booting, it is possible that systemd is so fast
27 that you have no chance to see them (that happens in my laptop with a
28 solid state harddrive). Also, if you have a splash (like plymouth),
29 the whole point of the splash is that you don't see said messages. You
30 can see a copy of the "boot log" in /var/log/boot.log; that it's what
31 you are supposed to see when booting, but if you have a splash you
32 won't, or maybe it will be so fast that you will miss it.
33
34 > Secondly I want to merge the journal into syslog-ng for post-processing. I
35 > have the correct syslog-ng service defined and syslog-ng.conf has been
36 > modified to use /run/systemd/journald/syslog as a source unix-stream. But I
37 > see no systemd messages appearing. In the Gentoo package all the
38 > journald.conf statements are commented out, which ones are necessary to do
39 > what I want. I have tried the "logging_to_syslog/kmsg" options but to no
40 > effect, but there are many!
41
42 I switched from syslog-ng to rsyslog around three years ago, and
43 exclusively to the journal some months ago, so this is from memory:
44
45 1. You need to link your syslog service unit to
46 /etc/systemd/system/syslog.service; for example:
47
48 /etc/systemd/system/syslog.service -> /usr/lib/systemd/system/syslog-ng.service
49
50 2. You need to set LogTarget=syslog (or LogTarget=syslog-or-kmsg) in
51 /etc/systemd/system.conf. You are configuring *systemd* to use a third
52 party syslog; you don't need to configure the journal itself.
53
54 man 5 systemd.conf
55 man 1 systemd
56
57 If I recall correctly, that's it. systemd automatically will buffer
58 the early boot messages until your preferred syslog service start, and
59 from that point on it will send the logs to it immediately.
60
61 Hope it helps.
62
63 Regards.
64 --
65 Canek Peláez Valdés
66 Posgrado en Ciencia e Ingeniería de la Computación
67 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] Questions about systemd logging Robin Atwood <robin.atwood@×××××××××.net>