[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#653673: the live-config init.d script should depend on mountkernfs



I attached /etc/init.d/mountkernfs.sh, and /lib/live/config/002-user-setup
Only two modifications have been made: I added a sleep statement to each:
002-user-setup:72  contains: sleep 40
mountkernfs.sh:120 contains: sleep 20

This will force the bug to show up Every time you try to boot.
The error message says that it can't read /tmp/debconf.live.
I tested it with qemu, virtualbox 2 cores, virtualbox 1 core.

Without the sleep commands added (everything default), the bug appeard
for me in a virtualbox 1-core configuration, about 1 out of 20 times i booted
the image.

I hope this is enough to reproduce.
> first; /etc/init.d/live-config always has absolutely to be the first
> script that gets executed, we do depend on that, if live-config is not
> the first thing, then other things later during system start may not
> work as they should. therefore, there should never by any depends within
> the live-config initscript to another initscript.

There are a couple cases to discuss:
First, yes, I understand it is important for live-config to run as
soon as possible, because other scripts
might need the modifications it makes.
But live-config needs something too: It needs a writable /tmp partition.
And this /tmp partition can't be remounted while live-config is in execution,
or otherwise temporary data in it will be lost.

Currently what happens is that mountkernfs.sh and live-config gets executed
Concurrently. When the mount command happens to get executed right
between the writing and reading of temporary data, then the temp data ends
up in /live/cow/tmp/debconf.live (trough the aufs), and user-setup
tries to read it from
/tmp/debconf.live (which is now a pure tmpfs).

When the mount happens before, the data is written and read from the tmpfs
When the mount happens after, the data is written and read from the aufs.

That is why it's hard to reproduce without adding the "sleep" commands.

It is fine if live-config runs before mountkernfs.sh, but they can't
run concurrently.
Then mountkernfs.sh must depend of live-config, and that modification
can only be
made in the chroot stage, and that modification will not be good for
non-live systems.

Currently mountkernfs.sh doesn't depend on anything. So making
live-config depend on
mountkernfs.sh will let live-config run as the second script. in the
boot process.
Does live-config really affect the functioning of mountkernfs.sh?
Even in rcS.d live-config is configured third, After mountkernfs.sh.
All we need to make sure is that they don't execute concurrently.

-- 
Purdea Andrei
http://purdea.ro
student at the “Politehnica” University of Timisoara
Faculty of Automation and Computers (AC)
Master's Degree Program - Computer Engineering (MCE)
2nd year

Attachment: mountkernfs.sh
Description: Bourne shell script

Attachment: 002-user-setup
Description: Binary data


Reply to: