[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I do not need "prerm"...



Hi Michelle.

Michelle Konzack wrote on 01/08/2005 19:57:
> in my debian/rules I use:
>
>     dh_installinit  -- start 80 S .
>
> and 'dh_installdeb' create those files
>
>     postinst
>     prerm
>     postrm
>
> but if I remove the package I get every time the message, that there
> is no running daemon found.  This is right, because in my init script

What message is that exactly and how does the prerm script look like?
The one my only current daemon package has basically looks like this:

# Automatically added by dh_installinit
if [ -x "/etc/init.d/spampd" ]; then
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                invoke-rc.d spampd stop || exit 0
        else
                /etc/init.d/spampd stop || exit 0
        fi
fi
# End automatically added section

Is that the same with your package? If yes, then the message you report
should just be a warning, but the removal should still work. Otherwise
it would help to see the prerm script generated for your package.
I wonder though: the prerm script I quoted above doesn't give any
message, so the only source for that message would be _your_ init
script. I can't see any such message in it though:

> I have:
>
>     case "$1" in
>       start|restart|reload|force-reload)
>         echo -n "Starting $DESC: $NAME: "
>         tdlinuxcounter --boot
>         ;;
>     stop)
>         ;;
>
> It create only at startup an uniq ID.  Thats all.  Now I was searching
> the manuals how to stop 'dh_installdeb' to create the "prerm".

One problem exists with init scripts which don't return 0 when called to
"stop", but AFAIK, that doesn't affect package removal.
What you obviously can do are these alternatives:
1) don't use dh_installinit but copy your init script manually and
   create the link in /etc/rcS.d manually in your postinst script.
   (and remove it in postrm)
2) use dh_installinit, but remove the generated prerm script afterwards
   in debian/rules

cu,
sven

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: