FS#27943 - [initscripts] /var/log/boot not updated on mdadm raid

Attached to Project: Arch Linux
Opened by Jonathan Liu (net147) - Sunday, 15 January 2012, 01:19 GMT
Last edited by Tom Gundersen (tomegun) - Sunday, 15 January 2012, 14:16 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Eric Belanger (Snowman)
Tom Gundersen (tomegun)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
/var/log/boot is not updated booting on mdadm raid.
The / partition is mounted as readonly so bootlogd is unable to write to /var/log/boot and silently fails with exit code of 1.

Additional info:
* initscripts 2012.01.2-1
* mdadm 3.2.2-4

Steps to reproduce:
1. Boot system running on mdadm raid
2. ls -l /var/log/boot and notice that it was not updated
This task depends upon

Closed by  Tom Gundersen (tomegun)
Sunday, 15 January 2012, 14:16 GMT
Reason for closing:  Upstream
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 01:42 GMT
I'm not sure the partition being mounted as readonly is the problem actually...
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 02:03 GMT
Looks like a problem in sysvinit bootlogd. It is unable to determine the console device.
Comment by Eric Belanger (Snowman) - Sunday, 15 January 2012, 03:52 GMT
It's a problem with the initscripts. It should run bootlogd with the -l option to set the logfile to a different location (/run ?)or start the logging after the root partition has been remounted rw.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 04:04 GMT
It doesn't look like that at all to me. It still doesn't work if I specify /run/bootlog as the location to write the logfile. I traced the problem inside the source code to where it tries to locate the console device in the consolename() function:
if (errno != ENOIOCTLCMD) return -1;

This causes the main() function to return with exit code 1.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 04:08 GMT
It works if I comment out that line.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 04:22 GMT
errno is 22 (EINVAL - invalid argument).
This is occurring on two Arch Linux servers i'm running (kernel26-lts 2.6.32.53-1 with root filesystem on mdadm RAID 1).
Comment by Eric Belanger (Snowman) - Sunday, 15 January 2012, 04:25 GMT
It's possibles that there are two problems here.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 04:40 GMT
https://bugzilla.novell.com/show_bug.cgi?id=681825
Seems that TIOCGDEV is only supported for kernel >= 2.6.38.

I have tested with the linux 3.1.9-1 and it works fine there.
I think we just need to add a patch to sysvinit package to also support the older kernel used for kernel26-lts.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 04:44 GMT
Fix to support kernel26-lts
Comment by Eric Belanger (Snowman) - Sunday, 15 January 2012, 06:45 GMT
If that's the case, then it isn't really worth fixing sysvinit. There is currently a linux-lts 3.0.17 package in testing intended to replace the kernel26-lts package currently in core. Once it'll be moved to core (after required signoff), the problem will disappear by itself.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 08:54 GMT
What about for older kernels in AUR?
Comment by Tom Gundersen (tomegun) - Sunday, 15 January 2012, 10:43 GMT
@Eric and Jonathan: Thanks for figuring this out!

As Eric noted kernel26-lts is at its EOL, so this problem will solve itself very soon. I don't think it is a good idea to add any patches to fix old kernels, mainly because I don't think we should give the impression that they are at all supported. Using old kernels on new userspace (such as initscripts/sysvinit) is not a good idea. We try to make an exemption for linux-lts, but that's about it.

If you want the problem solved, I think it would be more effective to submit your patch upstream to sysvinit, they probably want to support older kernels (and I'm a bit surprised that this is broken actually).
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 10:52 GMT
It could be the reason that it is broken is that it is using newer kernel headers which define TIOCGDEV even though it may not be supported by kernels < 2.6.38.
Comment by Jonathan Liu (net147) - Sunday, 15 January 2012, 11:03 GMT

Loading...