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

Re: RFC: new update-inetd



Previously Anthony Towns wrote:
> postinst:
>     if [ "$1" = "configure" -a "$2" = "" ]; then
>         update-inetd add cvspserver tcp /usr/sbin/cvs-pserver --hint=tcpd
>     elif [ "$1" = "configure" ]; then
>         update-inetd enable cvspserver tcp /usr/sbin/cvs-pserver remove-cvs
>     fi

This is wrong: upgrading a package should not re-enable a service if the
admin disabled it. I also doubt that add should imply enable, I would
prefer for those to be seperate options. That would also be more
consistent with the seperate disable and remove options.

How about:

postinst:
    if [ "$1" = "configure" -a "$2" = "" ]; then
        if ! update-inetd query cvspserver > /dev/null 2>&1 ; then
            update-inetd add cvspserver tcp /usr/sbin/cvs-pserver --hint=tcpd
	fi
        update-inetd enable cvspserver 
    elif [ "$1" = "configure" ]; then
        if ! update-inetd query cvspserver > /dev/null 2>&1 ; then
            update-inetd add cvspserver tcp /usr/sbin/cvs-pserver --hint=tcpd
        fi
    fi

This would have the advantage that it doesn't override an admins choice
to disable a service or use a different version of it.

Wichert.

-- 
  _________________________________________________________________
 /       Nothing is fool-proof to a sufficiently talented fool     \
| wichert@cistron.nl                  http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |



Reply to: