Re: dpkg can't purge init script
On Thu, Aug 23, 2001 at 12:05:01AM +0100, Julian Gilbey wrote:
> On Wed, Aug 22, 2001 at 07:44:29PM +0200, Eric Van Buggenhaut wrote:
> > I can't purge a package :
> >
> > curitiba_POTATO:/# dpkg --purge superviser-server
> > (Reading database ... 9401 files and directories currently installed.)
> > Removing superviser-server ...
> > Stopping superviser-server: dpkg: error processing superviser-server (--purge):
> > subprocess pre-removal script returned error exit status 1
>
> [BTW, should the package be called supervisOr-server?]
>
> So it looks as though the superviser-server init.d stop script exited
> with exit status 1 instead of 0.
>
> > Here comes the script :
> >
> > [eric@curitibaPOTATO:~/arturo/superviser-server-1.0]$ more debian/prerm
> > #! /bin/sh
> > # prerm script for superviser-server
> > #
> > # see: dh_installdeb(1)
> >
> > set -e
>
> so it will exist on any error...
>
> > case "$1" in
> > remove|upgrade|deconfigure)
> > # install-info --quiet --remove /usr/info/superviser-server.info.gz
> > ;;
> >
> > failed-upgrade)
> > ;;
> > *)
> > echo "prerm called with unknown argument \`$1'" >&2
> > exit 0
>
> This should probably be "exit 1".
Well, my script is the exact copy of the skeleton found in
/usr/share/debhelper/dh_make/debian/prerm.ex where it is "exit 0"
>
> > ;;
> > esac
> >
> > # dh_installdeb will replace this with shell code automatically
> > # generated by other debhelper scripts.
> >
> > #DEBHELPER#
> >
> > exit 0
>
>
> > And the debhelper script :
> >
> > [eric@curitibaPOTATO:~/arturo/superviser-server-1.0]$ more debian/prerm.debhelper
> > # Automatically added by dh_installdocs
> > if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/superviser-server ]; then
> > rm -f /usr/doc/superviser-server
> > fi
> > # End automatically added section
>
> OK there.
>
> > # Automatically added by dh_installinit
> > /etc/init.d/superviser-server stop
> > # End automatically added section
>
> And that's OK, _as long as /etc/init.d/superviser-server stop returns
> with a zero exit status_.
>
> > Is this a bug in debhelper ?
>
> Doesn't appear to be. Check that /etc/init.d/superviser-server uses
> the correct exit status.
Again, /etc/init.d/superviser-server is a copy of the skeleton found in
/usr/share/debhelper/debian/init.d.ex :
[eric@curitiba:~]$ diff -u /usr/share/debhelper/dh_make/debian/init.d.ex
chroot/potato/home/eric/arturo/superviser-server-1.0/debian/init.d
--- /usr/share/debhelper/dh_make/debian/init.d.ex Wed Mar 14 22:25:48
2001
+++ chroot/potato/home/eric/arturo/superviser-server-1.0/debian/init.d Fri Jul
27 13:10:59 2001
@@ -9,12 +9,14 @@
#
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
#
-# This file was automatically customized by dh-make on #DATE#
+# This file was automatically customized by dh-make on Fri, 27 Jul 2001
11:27:34 +0200
+#
+# Modified for superviser-server by Eric Van Buggenhaut <eric@andago.com>
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/#PACKAGE#
-NAME=#PACKAGE#
-DESC=#PACKAGE#
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/superviser-server.pl
+NAME=superviser-server
+DESC=superviser-server
test -f $DAEMON || exit 0
[eric@curitiba:~]$
Problem seems to be that prerm remove fails :
curitiba_POTATO:/# /var/lib/dpkg/info/superviser-server.prerm remove ; echo $?
Stopping superviser-server: 1
curitiba_POTATO:/#
Because :
curitiba_POTATO:/# start-stop-daemon --stop --quiet --pidfile
/var/run/superviser-server.pid --exec /usr/sbin/superviser-server.pl ; echo $?
1
curitiba_POTATO:/#
If you have any idea ...
Thanks for your help anyway.
PS : I'll move this thread to -mentors, where it belongs to
--
Eric VAN BUGGENHAUT "Real Programers don't use Pascal"
\_|_/ Andago
\/ \/ Av. Santa Engracia num 54
a n d a g o |-- Telef: 91-2041100
/\___/\ http://www.andago.com
/ | \ "Innovando en Internet"
eric@andago.com
Reply to: