[+] dpkg-reconfigure sysv-rc skrypty bez tagów LSB

Ogólne pytania dotyczące systemu
Awatar użytkownika
DaVidoSS
Junior Member
Posty: 875
Rejestracja: 06 marca 2010, 11:26
Lokalizacja: ~/

[+] dpkg-reconfigure sysv-rc skrypty bez tagów LSB

Post autor: DaVidoSS »

Cześć. Mam kłopot z sysv-rc, który podczas aktualizacji systemu się przestraszył skryptów które umieściłem w systemie miedzy innymi dzięki naszemu forum. Nie jestem w stanie sobie pomóc sam gdyż skryptologiem nie jestem. Jak to naprawić? System to Debian -Sid .


Kod: Zaznacz cały

 
 Unable to migrate to dependency-based boot system                                                                         │                                                          
 │                                                                                                                           │                                                          
 │ Tests have determined that problems in the boot system exist which prevent migration to dependency-based boot             │                                                          
 │ sequencing:                                                                                                               │                                                          
 │                                                                                                                           │                                                          
 │ insserv: warning: script 'K20firewall' missing LSB tags and overrides, insserv: warning: script 'firewall' missing LSB    │                                                          
 │ tags and overrides, insserv: warning: script 'UPGRADE.MONITOR' missing LSB tags and overrides,                            │                                                          
 │                                                                                                                           │                                                          
 │ If the reported problem is a local modification, it needs to be fixed manually. If it's a bug in the package, it should   │                                                          
 │ be reported to the BTS and fixed in the package. See http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot for more   │                                                          
 │ information about how to fix the problems preventing migration.                                                           │                                                          
 │                                                                                                                           │                                                          
 │ To reattempt the migration process after the problems have been fixed, run "dpkg-reconfigure sysv-rc".     

Kod: Zaznacz cały

davidoss@debian-sid-2010:~$ cat /etc/init.d/firewall 
#!/bin/sh
##
##   DESKTOP FIREWALL by grzesiek ;)
##
##

start () {

iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat

iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT DROP

# INPUT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i !eth0 -s 192.168.0.0/16 -p udp -m multiport --dport 137,138 -m state --state NEW -j ACCEPT
iptables -A INPUT -i !eth0 -s 192.168.0.0/16 -p tcp -m multiport --dport 139,445 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
iptables -A INPUT -i lo -m state --state NEW -j ACCEPT
iptables -A INPUT -p icmp -m state --state NEW -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited

# OUTPUT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 1024:65535 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --sport 1024:65535 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p icmp -m state --state NEW -j ACCEPT
iptables -A OUTPUT -j REJECT --reject-with icmp-host-prohibited

# FORWARD
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/255.255.0.0 -p tcp --sport 1024:65535 -m state --state NEW -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/255.255.0.0 -p udp --sport 1024:65535 -m state --state NEW -j ACCEPT
iptables -A FORWARD -p icmp -m state --state NEW -j ACCEPT
iptables -A FORWARD -j REJECT --reject-with icmp-host-prohibited

# NAT system
iptables -t nat  -A POSTROUTING -s 192.168.0.0/255.255.0.0 -d 0/0 -j  MASQUERADE

echo "Configuration iptables on... (more information use option: show)"
exit 0
}

stop () {
iptables -F
iptables -X
iptables -F -t nat
iptables -X -t nat

iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT

iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.0.0 -d 0/0 -j  MASQUERADE

echo "Configuration iptables off (except NAT system for 192.168.0.0/16 !)... (more information use option: show)"
exit 0
}

show () {
echo "\n                            [ Table: filter ]\n"
iptables -L -nv --line-numbers -t filter
echo "\n                            [ Table: nat ]\n"
iptables -L -nv --line-numbers -t nat
echo "\n"
exit 0
}

#main:
case "$1" in 
        start)
                start ;;
        stop)
                stop ;;
        show)
                show ;;
        *)
                echo $"  Składnia: $0 {stary, stop, show}"
                echo "@@@ Firewall by grzesiek ;) @@@"
                exit 1
esac

Kod: Zaznacz cały

davidoss@debian-sid-2010:~$ cat /etc/init.d/UPGRADE.MONITOR 
#!/bin/bash

logfile="/var/log/upgrades.log"
lista() {
        apt-get dist-upgrade -s | grep 'Inst'
}

apt-get update 2>&1 >/dev/null
if [ -z "$(lista)" ]; then
        echo "Brak" > $logfile
else
        echo "$(lista | sed '/^Inst/!d;{s/Inst\ //;s/\ .*//}')" > $logfile
fi

fnmirk
Senior Member
Posty: 8321
Rejestracja: 03 grudnia 2007, 06:37

Post autor: fnmirk »

Awatar użytkownika
DaVidoSS
Junior Member
Posty: 875
Rejestracja: 06 marca 2010, 11:26
Lokalizacja: ~/

Post autor: DaVidoSS »

Dziękuje.
Dodałem do każdego na początek :

Kod: Zaznacz cały

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO


i poszło.
ODPOWIEDZ