View Single Post
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#39
Originally Posted by penguinbait View Post
Is it possible to have it run ldconfig after deb install?
Add a 'postinst' script to the package. It can typically check/change permissions and directories, run ldconfig, and, for this system, it should presumably also start the printer daemon. The one below is what I use for the 'lprng' package, presumably it should be something similar for 'cups', but with the additional ldconfig.

The lprng postinst script (Maemo version):
Code:
#!/bin/sh

set -e
case "$1" in
    install|upgrade)
    ;;

    configure)
        # Create directories for pid file
        if test ! -d /var/run/lprng; then
            mkdir /var/run/lprng
        fi
        chown root.lp /var/run/lprng
        chmod 0775 /var/run/lprng
        for fname in `ls /var/spool/lpd 2>/dev/null`; do
            if [ -d $fname ] ; then
                chown -R lp:lp /var/spool/lpd/$fname
                chmod 0700 /var/spool/lpd/$fname
            fi
        done
        chown daemon.lp /var/spool/lpd
        chmod 0700 /var/spool/lpd
        for fname in lpr lprm lpq; do
            chown root.lp /usr/bin/$fname
            chmod u+s /usr/bin/$fname
            chmod g+s /usr/bin/$fname
        done
        if [ ! -e /etc/printcap ] ; then
            cp /etc/lprng/printcap.example /etc/printcap
        fi
        ;;
    abort-upgrade)
        ;;
    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
        ;;
esac

# Have to manually start lprng as a failed startup is not a failed install
if [ -x "/etc/init.d/lprng" ]; then
        update-rc.d lprng defaults >/dev/null
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
            invoke-rc.d lprng start || true
        else
            /etc/init.d/lprng start || true
        fi
fi
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.