Comment 2 for bug 619246

Revision history for this message
James Troup (elmo) wrote :

This bug is still present in Oneiric.

The root cause is that invoke-rc.d misuses 'RUNLEVEL' as a local
variable for the full path to the runlevel(8) binary. As long as
'RUNLEVEL' isn't defined in the environment this doesn't have any
particular ill effects. However, if 'RUNLEVEL' is defined in the
environment (as it is during bootup), the local variable gets marked
for export[1] and thus when runlevel(8) is invoked it sees RUNLEVEL as
'/sbin/runlevel' which causes it to give bad output ('/ N').

One easy/obvious way to avoid this is to have invoke-rc.d to use
'RUNLEVELHELPER' as the variable name for the full path to the
runlevel(8) binary instead of 'RUNLEVEL'.

I've attached a debdiff which does this and I've tested patched
packages on both lucid (server) and natty (desktop), including a full
reboot cycle. It both fixes the originally reported problem and
doesn't seem to introduce any other problems. It'd be nice if we
could get this into Oneiric and then SRU it into Lucid (as the current
and affected LTS).

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03
    [With thanks to Colin Watson and Robert Collins.]