Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd sends messages to the console
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Sun Dec 07, 2014 10:07 pm    Post subject: systemd sends messages to the console Reply with quote

Gentlemen,

Years ago I have installed Gentoo my the first time. Many tears was shed until I was able to assemble and fine tune my system as I wanted to do. Since that we lived in perfect harmony with my Gentoo. I liked it and did not think that those times when I do not understand anything back to me.

But they came back - Gentoo switched to systemd...

I've installed the system as it described at handbook for systemd but many things are not working as expected. Exactly the problem: I found that systemd-udev daemon sends its internal messages via stderr directly to active console and I cannot stop them.

Careful study showed that the demon systemd-udev streams stdin, stdout and stderr stay assigned to /dev/console at the time, as in "proper daemon" they must be assigned to /dev/null. I do not know if this is a bug in the program or is so designed and intercepting and redirecting the standard streams to the log daemon makes itself systemd. In the documentation it is briefly mentioned this possibility of it.

In any case, I do not know how to stop issuing these messages to the console. Perhaps something I did not finish. If someone can - explain why and tell me at least where to look and what to read.

Sincerely
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10261
Location: Somewhere over Atlanta, Georgia

PostPosted: Sun Dec 07, 2014 10:54 pm    Post subject: Reply with quote

Well, the first misconception is that Gentoo did not switch to systemd. systemd is merely one of the choices of init systems that you can make during an install. So the first question is, do you really need it or did you just think that Gentoo switched?

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Sun Dec 07, 2014 11:35 pm    Post subject: Reply with quote

John R. Graham wrote:
So the first question is, do you really need it or did you just think that Gentoo switched?

- John


You are infinitely good to me :)

Command

'ps -p 1 -o comm='

displays

'systemd'.

Is it enough proof?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10261
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Dec 08, 2014 12:07 am    Post subject: Reply with quote

What I'm asking is, why did you install with systemd when the traditional Gentoo init system, openrc, is still available? I'm not asking, "Do you have systemd installed?," but instead, "Why do you have systemd installed?"

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Mon Dec 08, 2014 12:34 am    Post subject: Reply with quote

John R. Graham wrote:
What I'm asking is, why did you install with systemd when the traditional Gentoo init system, openrc, is still available? I'm not asking, "Do you have systemd installed?," but instead, "Why do you have systemd installed?"

- John


It seems to me obviously - I need just 'systemd' in my professional practice. Many other distributives switch to systemd initialization. Ubuntu itself is going to do that. Even Ubuntu! In the nearest future it will be mandatory to know systemd for any system administrator. But I am program developer I need it quicklier :)

I know what they say about systemd in the community. I am working with OpenRC and I know OpenRC. I don't want to change anything because curiosity only, I have more profitable business. But my tiny practice with systemd shows still need to know it because it is more "system solve" than SysV init. In fact, the inclusion of systemd in portage tree distribution as officially proposed solution is the recognition of this. Therefore... I need. It's quite painful but I need. Can you really help me in this exact problem? I would be grateful for any ideas.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10261
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Dec 08, 2014 3:02 am    Post subject: Reply with quote

Sorry; I am unable to help. Hopefully someone else will respond.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7089
Location: Saint Amant, Acadiana

PostPosted: Mon Dec 08, 2014 3:06 am    Post subject: Reply with quote

Install Debian in a virtual machine for practicing? It is as easy as apt-get install systemd systemd-sysv and a reboot to get into systemd.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
solo_segler
n00b
n00b


Joined: 17 Aug 2002
Posts: 17
Location: Vienna, Austria

PostPosted: Mon Dec 08, 2014 12:00 pm    Post subject: Reply with quote

Hi,

you have to edit your /etc/systemd/journald.conf. There is an option called "ForwardToWall". Set this to "no" or uncomment this.
I hope this solves your problem.

Christian
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1654
Location: United Kingdom

PostPosted: Mon Dec 08, 2014 1:06 pm    Post subject: Reply with quote

solo_segler wrote:
Hi,

you have to edit your /etc/systemd/journald.conf. There is an option called "ForwardToWall". Set this to "no" or uncomment this.
I hope this solves your problem.

Christian

"ForwardToConsole"?

Code:
$ cat /etc/systemd/journald.conf | grep -i forward
#ForwardToSyslog=yes
#ForwardToKMsg=no
#ForwardToConsole=no

_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
solo_segler
n00b
n00b


Joined: 17 Aug 2002
Posts: 17
Location: Vienna, Austria

PostPosted: Mon Dec 08, 2014 3:23 pm    Post subject: Reply with quote

Hi,

here is my journald.conf. I have set the output of journald to tty12. I am running stable systemd 215-r3 because I want to use Gnome 3.12.0.

Code:

christian@chr_gentoo ~ $ cat /etc/systemd/journald.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# See journald.conf(5) for details

[Journal]
#Storage=auto
#Compress=yes
#Seal=yes
#SplitMode=uid
#SyncIntervalSec=5m
#RateLimitInterval=30s
#RateLimitBurst=1000
#SystemMaxUse=
#SystemKeepFree=
SystemMaxFileSize=2G
#RuntimeMaxUse=
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#MaxRetentionSec=
#MaxFileSec=1month
#ForwardToSyslog=yes
#ForwardToKMsg=no
ForwardToConsole=yes                                                                                                                                                                                                                                             
#ForwardToWall=yes
TTYPath=/dev/tty12
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
#MaxLevelWall=emerg


Christian
Back to top
View user's profile Send private message
sternml700
n00b
n00b


Joined: 08 Dec 2014
Posts: 1

PostPosted: Mon Dec 08, 2014 4:42 pm    Post subject: Reply with quote

this work
Back to top
View user's profile Send private message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Mon Dec 08, 2014 11:00 pm    Post subject: Reply with quote

Gentlemen,

I am very thankful and grateful for the advices given to me. But none of them helped. In particular, the advice of solo_segler to remove the comment sign from some lines in the file /etc/systemd/journald.conf causes the system to hang during initialization. If to return comment signs - initialization proceeds normally.

The advice of Jaglover is very good, if I had a host system in which I can deploy the virtual machine. Namely, the host system I'm trying to set up :)

The decision marked the words "this work" of sternml700 I have not worked at all.

Nevertheless, I note the following. I installed Gentoo using the LiveDVD, which is compiled based on the sys-app/systemd-215-r3. And when I boot of this DVD, I don't see those messages systemd, which haunt me when booting the installed system of mine. In general, the situation is such that in the directory /etc/systemd/ LiveDVD all configuration files contain comments only. There commented out everything.

But! The console command

ps aux | grep udev

in the system of the LiveDVD reports

... PID ... /usr/lib/systemd/systemd-udevd --daemon

and in system of mine it says

... PID ... /usr/lib/systemd/systemd-udevd

i. e. the program /usr/lib/systemd/systemd-udevd in my system runs without option --daemon.

At the same time, if I get to a /proc/PID/fd/ directory, then the system of LiveDVD I see the first three descriptors 0, 1 and 2 are directed to /dev/null (as befits a daemon), and in my system, I see them directed to /dev/console (which corresponds to the console program). Thus, those messages of systemd-udevd are streaming into the console.

If we assume that --daemon option determines the behaviour of the daemon, then everything is correct and regular - at the start of my system the program systemd-udevd receives no indication to become a daemon. It is not becoming.

Thus, the issue has become more exact - where and what do I correct for systemd-udevd started with the command line option --daemon? Perhaps, this is the cause of my troubles and its solution.

I will be grateful in advance for any ideas and if I find a solution myself, make sure I write it here.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5761

PostPosted: Wed Dec 10, 2014 2:55 pm    Post subject: Reply with quote

jivopyra wrote:
Nevertheless, I note the following. I installed Gentoo using the LiveDVD, which is compiled based on the sys-app/systemd-215-r3. And when I boot of this DVD, I don't see those messages systemd, which haunt me when booting the installed system of mine. In general, the situation is such that in the directory /etc/systemd/ LiveDVD all configuration files contain comments only. There commented out everything.

But! The console command

ps aux | grep udev

in the system of the LiveDVD reports

... PID ... /usr/lib/systemd/systemd-udevd --daemon

The LiveDVD uses OpenRC, not systemd. What you're doing there is looking at udev, not PID 1.
Back to top
View user's profile Send private message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Wed Dec 10, 2014 9:14 pm    Post subject: Reply with quote

Ant P. wrote:

The LiveDVD uses OpenRC, not systemd. What you're doing there is looking at udev, not PID 1.


I didn't tell about PID is equal 1... :) I told about some other matter.
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 362
Location: Inner Space

PostPosted: Thu Dec 11, 2014 8:44 pm    Post subject: Reply with quote

just guessing but: emerge -C systemd ?
_________________
((O.o))
Back to top
View user's profile Send private message
prote
n00b
n00b


Joined: 28 Jul 2006
Posts: 5

PostPosted: Fri Dec 12, 2014 2:54 pm    Post subject: Re: systemd sends messages to the console Reply with quote

jivopyra wrote:
Exactly the problem: I found that systemd-udev daemon sends its internal messages via stderr directly to active console and I cannot stop them.


I think I had a similar problem (got the startup messages of my bond0 and br0 devices).

This was caused by the kernel.printk settings:
Code:
# sysctl kernel.printk
kernel.printk = 7   1   1   7


The meaning of these numbers is explained here:
Code:
# man 2 syslog
...
   /proc/sys/kernel/printk
       /proc/sys/kernel/printk  is a writable file containing four integer values that influ‐
       ence kernel printk() behavior when printing or logging error messages.  The four  val‐
       ues are:

       console_loglevel
              Only  messages  with  a  log level lower than this value will be printed to the
              console.  The default value for this field is DEFAULT_CONSOLE_LOGLEVEL (7), but
              it  is set to 4 if the kernel command line contains the word "quiet", 10 if the
              kernel command line contains the word "debug", and to 15 in case  of  a  kernel
              fault  (the  10 and 15 are just silly, and equivalent to 8).  The value of con‐
              sole_loglevel can be set (to a value in the range 1-8) by a syslog() call  with
              a type of 8.

       default_message_loglevel
              This value will be used as the log level for printk() messages that do not have
              an explicit level.  Up to and including Linux 2.6.38,  the  hard-coded  default
              value  for  this  field  was  4 (KERN_WARNING); since Linux 2.6.39, the default
              value is a defined  by  the  kernel  configuration  option  CONFIG_DEFAULT_MES‐
              SAGE_LOGLEVEL, which defaults to 4.

       minimum_console_loglevel
              The  value  in this field is the minimum value to which console_loglevel can be
              set.

       default_console_loglevel
              This is the default value for console_loglevel.

   The log level
       Every printk() message has its own log level.  If the  log  level  is  not  explicitly
       specified  as  part of the message, it defaults to default_message_loglevel. The con-
       ventional meaning of the log level is as follows:


       Kernel constant   Level value   Meaning
       KERN_EMERG             0        System is unusable
       KERN_ALERT             1        Action must be taken immediately
       KERN_CRIT              2        Critical conditions
       KERN_ERR               3        Error conditions
       KERN_WARNING           4        Warning conditions
       KERN_NOTICE            5        Normal but significant condition
       KERN_INFO              6        Informational
       KERN_DEBUG             7        Debug-level messages

       The kernel printk() routine will print a message on the console only if it has  a  log
       level less than the value of console_loglevel.
...


My fix was:
Code:
# vi /etc/sysctl.d/printk.conf
kernel.printk = 3 1 1 7
# reboot
Back to top
View user's profile Send private message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Sun Dec 21, 2014 6:39 pm    Post subject: Reply with quote

e3k wrote:
just guessing but: emerge -C systemd ?


Regretfully it's impossible. I am software developer and I need to be familiar with systemd by my occupation. Even I dislike it by heart I must have arguments against it to argue opinion of my own. I have сolleagues, bosses and opponents :(

By the way I like the idea of systemd... still. I have read about it. Probably implementation of it will revert my preferences soon :(
Back to top
View user's profile Send private message
jivopyra
n00b
n00b


Joined: 07 Dec 2014
Posts: 9

PostPosted: Sun Dec 21, 2014 8:14 pm    Post subject: Re: systemd sends messages to the console Reply with quote

prote wrote:

My fix was:
Code:
# vi /etc/sysctl.d/printk.conf
kernel.printk = 3 1 1 7
# reboot


Dear sir,

Your advice was helpful. Рlease accept my sincere thanks, I myself would never have guessed that the problem is in this place.

Sincerely
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum