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

Re: Having problems with my (newly created) debian package



Your   new  package  is  not  the problem, here. It seems that the old
version  of your package provided a broken prerm script. So, when dpkg
try  to  uninstall  it  before  installing  the  new  version, it just
crashes.    What    you    could    do   is   just   modifying   the
/var/lib/dpkg/info/rcf.prerm  file,  in order to remove the bad lines,
those  who try to remove /etc/init.d/firewall. Or, maybe cleaner, just
do a :

echo -n "" > /etc/init.d/firewall

which  will  create  an  empty firewall file, which will be deleted by
dpkg.

But, be quiet, that isn't a problem (again! :) with your new package,

I did something to that effect, and deleted all the rcf.* files in /var/lib/dpkg/info, and it now works! the replace/uninstall also seems to work, which is good!

However, I get some errors (both the same, though) in the post-install (I think):

root@debian:~/rcf-5.0.1# dpkg -i rcf_5.0.1-1_i386.deb
(Reading database ... 47289 files and directories currently installed.)
Preparing to replace rcf 5.0.1-1 (using rcf_5.0.1-1_i386.deb) ...
/etc/init.d/firewall: [: =: unary operator expected
Unpacking replacement rcf ...
Setting up rcf (5.0.1-1) ...
Installing new version of config file /etc/init.d/firewall ...
/etc/init.d/firewall: [: =: unary operator expected

---

this is the /etc/init.d/firewall file:

#!/bin/sh
#
# firewall      This shell script takes care of starting and stopping
#               the firewall.
#
# chkconfig: 2345 11 90
# description: rc.firewall is an ipchains-based firewall script with \
#   extensive support for network services, masquerading, port \
#   forwarding, and IP accounting.
# processname:
# config: /etc/firewall.conf

# Source function library.
#. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/network/options

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -x /usr/sbin/rc.firewall ] || exit 0

[ -f /etc/firewall.conf ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
	start|restart|force-reload)
		/usr/sbin/rc.firewall
		RETVAL=$?
		if [ $RETVAL eq 0 ]
		then
			touch /var/lock/subsys/firewall
			echo "Firewall Started."
		else
			rm -f /var/lock/subsys/firewall
			echo "Error Starting Firewall!"
		fi
		;;
	stop)
		/usr/sbin/rc.firewall --accept-all
		RETVAL=$?
		[ $RETVAL eq 0 ] \
			&& rm -f /var/lock/subsys/firewall
        ;;
	status)
TOTAL_RULES="`ipchains -L -n|egrep -c '^(MASQ|ACCEPT|DENY|REJECT|-) *'`" echo "$TOTAL_RULES IPchains Firewall Rules (includes IP Accounting)"
        ;;
	*)
echo "Usage: `basename $0` {start|stop|restart|force-reload|status}"
		RETVAL=1
		;;
esac

exit $RETVAL

---

I cannot see any problems, however, and because of those 'unary operator expected' errors, I cannot complete the install or start the firewall!

Can anyone see any problems with the /etc/init.d/firewall file? It works (I presume) on RedHat and other systems, since I have installed it on my RedHat gateway and it works fine!

thanks



Reply to: