Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2026 closed defect (fixed)

sed syntax error in /etc/rc.d/rcsysinit.d/S05modules

Reported by: Thomas Seeling Owned by: dnicholson@…
Priority: normal Milestone:
Component: Bootscripts Version: SVN
Severity: normal Keywords:
Cc:

Description

the line in /etc/rc.d/rcsysinit.d/S05modules that finds out the current dmesg level has a syntax error in the last sed command

# cat /proc/sys/kernel/printk | sed 'l 1' | sed -n '2~0p' | sed 's/\\\//'
sed: -e expression #1, char 7: unterminated `s' command

this should be sed 's/\\//' (one less backslash)

Attachments (1)

new-modules.sh (1.6 KB ) - added by dnicholson@… 17 years ago.
The modules script I use on my system

Download all attachments as: .zip

Change History (7)

comment:1 by dnicholson@…, 17 years ago

In fact, the whole command is completely overkill (as is much of that script). Try

read level line < /proc/sys/kernel/printk
echo $level

But maybe I can use this opportunity to see what people think about the consolelog script I posted a while back. That would make the logging settings in init.d/modules useless.

http://linuxfromscratch.org/pipermail/lfs-dev/2007-April/059308.html

comment:2 by Matthew Burgess, 17 years ago

Milestone: 6.3

Regarding your consolelog script, I like it. The thread discusses the possibility of configuring the logging level via a sysctl parameter, but concludes it runs too late; it has to run after udev has finished, otherwise module parameters can't be set as their sysfs entries won't be present. However, a lot of the kernel chatter comes from udev loading modules in the first place, so it'd make sense to set the kernel logging level *before* udev. Therefore, I think the only sane solution is to have it set via its own bootscript. Unless, of course, the udev bootscript temporarily sets the logging level low, like the modules scripts does (personally, I don't think it should be doing that - it should be set in one and only one place). Dan, what other cleanups do you think S05modules could use? Care to conjure up a patch and send it to lfs-dev for review?

Thanks,

Matt.

comment:3 by dnicholson@…, 17 years ago

The main things are:

  • Remove the console loglevel handling. Should be handled globally for all services.
  • Remove the fd duplication. It's completely unnecessary. Just run the loop as such:
while read module args
do
...
done < /etc/sysconfig/modules
  • Don't suppress stderr on modprobe. There are other cases of this in our bootscripts, too (see mountfs). I don't know why we'd want to silence potentially critical errors during boot.

I'll attach what I use.

by dnicholson@…, 17 years ago

Attachment: new-modules.sh added

The modules script I use on my system

comment:4 by dnicholson@…, 17 years ago

Owner: changed from lfs-book@… to dnicholson@…
Status: newassigned

comment:5 by dnicholson@…, 17 years ago

Resolution: fixed
Status: assignedclosed

Should be fixed in r8222 which adds the consolelog script and kills the printk handling in modules.

comment:6 by Jeremy Huntwork, 17 years ago

Milestone: 6.3

Milestone 6.3 deleted

Note: See TracTickets for help on using tickets.