Subject: Bug#4122: update-rc.d failed

From: "Brian C. White" <[email-masked]>
Date: Tue, 13 Aug 1996 00:19:20 -0400

Package: dpkg
Version: 1.2.13elf

I'm trying to package "genpower" (a UPS monitoring daemon), but am having
trouble with the postinst:

  #! /bin/sh -e
  #
  # postinst file for genpower
  echo "- Installing 'start' ..."
  update-rc.d genpowerd start 11 1 2 3 4 5
  echo "- Installing 'stop' ..."
  update-rc.d genpowerd stop  99 0

The results of this are:

  Selecting previously deselected package genpower.
  (Reading database ... 14718 files and directories currently installed.)
  Unpacking genpower (from ../genpower_1.0.1-1_i386.deb) ...
  Setting up genpower (1.0.1-1) ...
  - Installing 'start' ...
   Adding system startup links pointing to /etc/init.d/genpowerd ...
     rc1.d/S11genpowerd -> ../init.d/genpowerd
     rc2.d/S11genpowerd -> ../init.d/genpowerd
     rc3.d/S11genpowerd -> ../init.d/genpowerd
     rc4.d/S11genpowerd -> ../init.d/genpowerd
     rc5.d/S11genpowerd -> ../init.d/genpowerd
  shift: shift count must be <= $#
  dpkg: error processing genpower (--install):
   subprocess post-installation script returned error exit status 1
  Errors were encountered while processing:
   genpower

I could not find any installed packages on my system that use
the "start" and "stop" commands instead of "defaults".

                                        Brian
                               ( [email-masked] )

-------------------------------------------------------------------------------
    In theory, theory and practice are the same.  In practice, they're not.

---

From: Ian Jackson <[email-masked]>
Date: Wed, 14 Aug 96 19:42 BST

Brian C. White writes ("Bug#4122: update-rc.d failed"):
...
>   update-rc.d genpowerd stop  99 0
...
>   shift: shift count must be <= $#
...
> the "start" and "stop" commands instead of "defaults".

Hmm.  You should have had a usage message instead of the internal
error.  This will be fixed in dpkg 1.3.6.

The usage message is rather cryptic, but it does say

] usage: update-rc.d <basename> remove
]        update-rc.d <basename> defaults [<cn> | <scn> <kcn>]
]        update-rc.d <basename> start|stop <cn> <r> <r> .  ...
                                                        ^
that you need a dot at the end of the argument list.

You should replace your two calls with one:
   update-rc.d genpowerd start 11 1 2 3 4 5 . stop 99 0 .

I'll close this bug report now.

Ian.