![Rodrigo Rodrigo](//static.vivaolinux.com.br/imagens/fotos/49fc208bfaf0.jpg)
rodrigocontrib
(usa Debian)
Enviado em 12/08/2014 - 20:21h
Srs, ao tentar inicializar o meu script de firewall no meu laboratorio com o comando :
root@GW:~# update-rc.d firewall.sh defaults o serviço me apresentou os erros abaixo, inseri um link no runlevel padraõ do meu sistema e funcionou legal, no entanto fica a duvida do que seria o erro.
Segue abaixo também a configuração do meu script de GW de testes:
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: firewall.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (none)
insserv: Script firewall.sh is broken: incomplete LSB comment.
insserv: missing `Default-Start:' entry: please add even if empty.
insserv: Script firewall.sh is broken: incomplete LSB comment.
insserv: missing `Default-Start:' entry: please add even if empty.
insserv: Script firewall.sh is broken: incomplete LSB comment.
insserv: missing `Default-Start:' entry: please add even if empty.
insserv: Script firewall.sh is broken: incomplete LSB comment.
insserv: missing `Default-Start:' entry: please add even if empty.
insserv: Script firewall.sh is broken: incomplete LSB comment.
insserv: missing `Default-Start:' entry: please add even if empty.
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `firewall.sh'
root@GW:~#
Conteudo do script :
#!/bin/bash
#
#
### BEGIN INIT INFO
# Provides: firewall.sh
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start firewall.sh at boot time
# Description: Enable service provide by firewall.sh
### END INIT INFO
start()
{
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A FORWARD -i eth2 -j ACCEPT
iptables -A FORWARD -i eth3 -j ACCEPT
#Habilitando Forward
echo 1 > /proc/sys/net/ipv4/ip_forward
}
stop()
{
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
#Desabilitando o FORWARD
echo 0 > /proc/sys/net/ipv4/ip_forward
}
case "$1" in
start) start ;;
stop) stop ;;
restart) stop; iniciar ;;
*) echo
"use os parametros start ou stop"
esac
exit 0
root@GW:~#