Ken Moffat wrote:
> On Wed, Apr 23, 2014 at 12:09:26AM -0500, Bruce Dubbs wrote:
>> Ken Moffat wrote:
>>> On Sun, Apr 20, 2014 at 03:19:45PM -0500, Bruce Dubbs wrote:
>>>> Last night I was trying to figure out how to set the dmesg log level in
>>>> systemd.  It turns out that it can be done with sysctl and set:
>>>> kernel.printk = 4 4 1 7
>>>> where the numbers are console_loglevel, default_message_loglevel,
>>>> minimum_console_loglevel, and default_console_loglevel.  The only number
>>>> we really are concerned with is the first.
>>>> This can be done in either sysd or sysv, but it's not as simple as
>>>> setting LOGLEVEL=4 and then use dmesg -n $LOGLEVEL in a script which is
>>>> how we do it now.
>>>    I think that ought to be documented somewhere in LFS.  Googling for
>>> this, all that came up was a recommendation from Arch to pass
>>> loglevel=4 [ they actually recommend 3 ] among the boot arguments.
>>>    Also, I haven't ever needed to use sysctl in the past - it appears
>>> to be something that is set at runtime, so if I had needed it I
>>> would have put it in an initscript.  If I do this with systemd, how
>>> am I _supposed_ to do it ? [ google is not helpful, or I've got the
>>> wrong search args ].
>> Hmm.
>> 7.1.1:  "The /etc/systemd/system.conf file contains a set of items to
>> control basic operations. The default file has all entries commented out
>> with the default settings indicated. This file is where the log level
>> may be changed as well as some basic journal settings."
>> Perhaps I need to make that more obvious.

>   Thanks for the pointer (I have not built systemd at the moment,
> still trying to sort out enough details for me to have a chance of
> getting the whole thing working).  But your use of sysctl looks
> unnecessarily long-winded : why not just something like this ? :
>   sed -i 's/#LogLevel=info/LogLevel=warning/' \
>    /etc/systemd/system.conf

I'm a bit confused.  Are you referring to what's in the -dev book right 
now?  Or the part about sysctl that I abandoned as possible but too complex?

Basically there is one sentence that mentions log level.  How is that 
long winded?

    -- Bruce
Unsubscribe: See the above information page

Reply via email to