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

Re: debhelper for python-central, problems with prerm/postinst



On Mon, 07 Jan 2008 19:36:32 +1100, Ben Finney
<bignose+hates-spam@benfinney.id.au> wrote:

>> On Mon, 07 Jan 2008 18:17:34 +1100, Ben Finney
>> <bignose+hates-spam@benfinney.id.au> wrote:
>> > So, how do Python-language packagers work around this bug
>> > currently?
>>
>> I don't use dh_installinit and I put the correct snippet in
>> postinst/prerm by hand, waiting for the bug to be fixed.
> 
> When you say "by hand", exactly when do you insert the postinst/prerm
> snippet? When making the 'debian/foo.{prerm,postinst}' files the first
> time? Immediately after building a binary package? Something else?

In postinst:

#DEBHELPER#

if [ -x "/etc/init.d/yourprogram" ]; then
        update-rc.d yourprogram defaults >/dev/null
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                invoke-rc.d yourprogram start || exit $?
        else
                /etc/init.d/yourprogram start || exit $?
        fi
fi

And in prerm :

if [ -x "/etc/init.d/yourprogram" ]; then
        if [ -x /usr/sbin/invoke-rc.d ] ; then
                invoke-rc.d yourprogram stop || exit $?
        else
                /etc/init.d/yourprogram stop || exit $?
        fi
fi

#DEBHELPER#

But as Josselin may have noted in his mail, you should just need to inoke
dh_installinit before dh_pycentral.



Reply to: