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: Fri, 11 Jan 2013 00:55:05
Message-Id: CADPrc82eJ0yzFeZ9gHJwQV8ERnf3KQVS=XmuOm1BHfwyVF1TMQ@mail.gmail.com
In Reply to: Re: [gentoo-user] Questions about systemd logging by Robin Atwood
1 On Thu, Jan 10, 2013 at 10:46 AM, Robin Atwood
2 <robin.atwood@×××××××××.net> wrote:
3 > On Thursday 10 January 2013, Canek Peláez Valdés wrote:
4 >
5 >> On Wed, Jan 9, 2013 at 5:12 AM, Robin Atwood <robin.atwood@×××××××××.net>
6 >> wrote:
7 >
8 >> > I have temporarily shelved my problem with mounting since my work-around
9 >
10 >> > seems adequate. But I have some questions about logging. Journald works
11 >
12 >> > fine but what am I supposed to see on the main console?
13 >
14 >>
15 >
16 >> What do you mean by "main console"? tty1? tty12? /dev/console?
17 >
18 >>
19 >
20 >> > All I can see is a few
21 >
22 >> > kernel messages which cease after the lvm service completes. There are
23 >> > no
24 >
25 >> > service starting messages and no login prompt appears. The other ttys
26 >
27 >> > have a banner and prompt as usual.
28 >
29 >>
30 >
31 >> systemd by default only spawns 1 (one) tty, tty1:
32 >
33 >>
34 >
35 >> $ ls /etc/systemd/system/getty.target.wants/
36 >
37 >> getty@××××.service
38 >
39 >>
40 >
41 >> That's the only login prompt spawned by default. The other virtual
42 >
43 >> consoles get spawned automatically if you switch to them. In other
44 >
45 >> words, if you never switch to the virtual console 2, there is no login
46 >
47 >> prompt there. It will appear until you switch to it. systemd should
48 >
49 >> switch to tty1 and launch getty@××××.service automatically when the
50 >
51 >> getty.target is reached in the boot process.
52 >
53 >>
54 >
55 >> I'm not really sure what the problem is; if you are concerned by the
56 >
57 >> "[ OK ]" messages when booting, it is possible that systemd is so fast
58 >
59 >> that you have no chance to see them (that happens in my laptop with a
60 >
61 >> solid state harddrive). Also, if you have a splash (like plymouth),
62 >
63 >> the whole point of the splash is that you don't see said messages. You
64 >
65 >> can see a copy of the "boot log" in /var/log/boot.log; that it's what
66 >
67 >> you are supposed to see when booting, but if you have a splash you
68 >
69 >> won't, or maybe it will be so fast that you will miss it.
70 >
71 >>
72 >
73 >> > Secondly I want to merge the journal into syslog-ng for post-processing.
74 >
75 >> > I have the correct syslog-ng service defined and syslog-ng.conf has been
76 >
77 >> > modified to use /run/systemd/journald/syslog as a source unix-stream.
78 >
79 >> > But I see no systemd messages appearing. In the Gentoo package all the
80 >
81 >> > journald.conf statements are commented out, which ones are necessary to
82 >
83 >> > do what I want. I have tried the "logging_to_syslog/kmsg" options but to
84 >
85 >> > no effect, but there are many!
86 >
87 >>
88 >
89 >> I switched from syslog-ng to rsyslog around three years ago, and
90 >
91 >> exclusively to the journal some months ago, so this is from memory:
92 >
93 >>
94 >
95 >> 1. You need to link your syslog service unit to
96 >
97 >> /etc/systemd/system/syslog.service; for example:
98 >
99 >>
100 >
101 >> /etc/systemd/system/syslog.service ->
102 >
103 >> /usr/lib/systemd/system/syslog-ng.service
104 >
105 >>
106 >
107 >> 2. You need to set LogTarget=syslog (or LogTarget=syslog-or-kmsg) in
108 >
109 >> /etc/systemd/system.conf. You are configuring *systemd* to use a third
110 >
111 >> party syslog; you don't need to configure the journal itself.
112 >
113 >>
114 >
115 >> man 5 systemd.conf
116 >
117 >> man 1 systemd
118 >
119 >>
120 >
121 >> If I recall correctly, that's it. systemd automatically will buffer
122 >
123 >> the early boot messages until your preferred syslog service start, and
124 >
125 >> from that point on it will send the logs to it immediately.
126 >
127 >
128 >
129 > Thanks for the tips, now I can get more output to tty1 if I want. I still
130 > can't get any systemd messages to syslog-ng, however. A bit of a mystery.
131
132 Stupid question, the syslog-ng.service is running correctly? What does
133 the following command say:
134
135 systemctl status syslog-ng.service
136
137 Regards.
138 --
139 Canek Peláez Valdés
140 Posgrado en Ciencia e Ingeniería de la Computación
141 Universidad Nacional Autónoma de México

Replies

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