Bug#828709: /usr/sbin/invoke-rc.d: uses non-essential /sbin/runlevel

2016-06-27 Thread Michael Biebl
Control: forcemerge 827376 -1


Hi Helmut

Am 27.06.2016 um 06:21 schrieb Helmut Grohne:
> Package: init-system-helpers
> Version: 1.35
> File: /usr/sbin/invoke-rc.d
> Severity: minor
> User: helm...@debian.org
> Usertags: rebootstrap
> 
> While removing e.g. x11-common, I saw the following message scrolling
> by:
> 
> | /usr/sbin/invoke-rc.d: 1: /usr/sbin/invoke-rc.d: /sbin/runlevel: not found
> | invoke-rc.d: could not determine current runlevel
> | invoke-rc.d: policy-rc.d denied execution of stop.
> 
> You can trigger it by debootstrapping a --variant=minbase sid chroot and
> using invoke-rc.d. In this case, it was removing x11-common.
> 
> Given that invoke-rc.d does the right thing in the absence of an init
> system, I mark this bug minor, but it could still explicitly check for
> that condition. What do you think about the attached patch?

This bug is already tracked at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827376

Please follow up there if you have further input.

Regards,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#828709: /usr/sbin/invoke-rc.d: uses non-essential /sbin/runlevel

2016-06-26 Thread Helmut Grohne
Package: init-system-helpers
Version: 1.35
File: /usr/sbin/invoke-rc.d
Severity: minor
User: helm...@debian.org
Usertags: rebootstrap

While removing e.g. x11-common, I saw the following message scrolling
by:

| /usr/sbin/invoke-rc.d: 1: /usr/sbin/invoke-rc.d: /sbin/runlevel: not found
| invoke-rc.d: could not determine current runlevel
| invoke-rc.d: policy-rc.d denied execution of stop.

You can trigger it by debootstrapping a --variant=minbase sid chroot and
using invoke-rc.d. In this case, it was removing x11-common.

Given that invoke-rc.d does the right thing in the absence of an init
system, I mark this bug minor, but it could still explicitly check for
that condition. What do you think about the attached patch?

Having init non-essential is otherwise pretty nice. :)

Helmut
--- init-system-helpers-1.35/script/invoke-rc.d
+++ init-system-helpers-1.35+nmu1/script/invoke-rc.d
@@ -295,7 +295,8 @@
 fi
 
 ## Queries sysvinit for the current runlevel
-if ! RL=`${RUNLEVELHELPER}`; then
+RL=
+if ! { test -x "$RUNLEVELHELPER" && RL=`${RUNLEVELHELPER}`; }; then
 if [ -n "$is_systemd" ] && systemctl is-active --quiet sysinit.target; then
 # under systemd, the [2345] runlevels are only set upon reaching them;
 # if we are past sysinit.target (roughly equivalent to rcS), consider