Your message dated Tue, 28 Jun 2016 13:00:42 +0200
with message-id <20160628110042.ga29...@piware.de>
and subject line Re: Bug#497665: invoke-rc.d: no-op test for failure to 
determine runlevel
has caused the Debian Bug report #497665,
regarding invoke-rc.d: no-op test for failure to determine runlevel
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
497665: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497665
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: sysv-rc
Version: 2.86.ds1-61
Severity: minor


The following two lines:

  RL=`${RUNLEVEL} | sed 's/.*\ //'`
  if test ! $? ; then

have two problems:

  - In Bourne shell, the return value of a pipeline is determined solely
    by the last command, here sed, which will pretty much always succeed
    (space or no space).

    This can be fixed either by splitting into two parts:

      RL=`${RUNLEVEL}`
      if ...
      fi
      RL=`echo "$RL" | sed 's/.* //'`

    or by switching from /bin/sh to /bin/bash and setting the pipefail
    option (after checking the effect on the rest of the script, I
    haven't looked).

  - In any case, `test ! $?' tests whether $? is empty, but $? is always
    non-empty (whether it's 0 or non-zero).  It should be

      if test $? != 0; then
         ... /sbin/runlevel failed ...

Should failure of /sbin/runlevel fall back to the ps -fp 1 trick,
perhaps piped to  sed -n 's/.*init \[\(.*\)\].*/\1/p' ?

(I haven't looked into the expected behaviour in chroots.)

pjrm.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-2-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

sysv-rc depends on no packages.

Versions of packages sysv-rc recommends:
ii  lsb-base                      3.2-19     Linux Standard Base 3.2 init scrip

Versions of packages sysv-rc suggests:
pn  bum                           <none>     (no description available)
pn  sysv-rc-conf                  <none>     (no description available)

-- no debconf information



--- End Message ---
--- Begin Message ---
Version: 1.33

pmoulder [2008-09-03 23:22 +1000]:
> The following two lines:
> 
>   RL=`${RUNLEVEL} | sed 's/.*\ //'`
>   if test ! $? ; then
> 
> have two problems:

[..]

I independently found that as a side issue in LP: #1575572 and
committed

  
http://anonscm.debian.org/cgit/collab-maint/init-system-helpers.git/commit/?id=2c444f0c

But it turned out that this breaks operations in chroots (Debian
#823611) so the check was partially reverted in

  
http://anonscm.debian.org/cgit/collab-maint/init-system-helpers.git/commit/?id=2aca09

Thus in 1.33 these two shell/sed problems are fixed, and the check
effectively removed.

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

Attachment: signature.asc
Description: PGP signature


--- End Message ---
_______________________________________________
Pkg-systemd-maintainers mailing list
Pkg-systemd-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to