Howdy all,

I'm packaging a service program implemented in Python. To run, the
program needs to import some modules from Python packages, and the
service provided by the Debian package uses an init script.

The default sequencing for Debhelper 7 means that code generated by
‘dh_installinit’ appears before code generated by either of
‘dh_pycentral’ or ‘dh_pysupport’ in the ‘postinst’ script.

The resulting postinst script is generated by debhelper with no explicit
mention of either ‘dh_installinit’ nor ‘dh_pysupport’:

=====
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/gracie" ]; then
        update-rc.d gracie defaults >/dev/null
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                invoke-rc.d gracie start || exit $?
        else
                /etc/init.d/gracie start || exit $?
        fi
fi
# End automatically added section
# Automatically added by dh_pysupport
if which update-python-modules >/dev/null 2>&1; then
        update-python-modules  gracie.public
fi
# End automatically added section
=====

The problem comes when the ‘dh_installinit’ code not only installs the
package init script, it tries to execute it to start the service. That
fails, of course, because the ‘dh_pysupport’ code has not yet been
executed and the Python packages are not yet available for import. (In
this case, this has been reported as Bug#519623.)

Should the default sequence for ‘dh_installinit’ not appear after
‘dh_pycentral’ or ‘dh_pysupport’? Should I report this as a bug in
Debhelper's default sequencing?

-- 
 \        “Absurdity, n. A statement or belief manifestly inconsistent |
  `\            with one's own opinion.” —Ambrose Bierce, _The Devil's |
_o__)                                                Dictionary_, 1906 |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to