Firewall-autorun

Discussions Regarding Software

Moderator: Moderators

gledof
Young Hen
Posts: 31
Joined: Thu Jan 29, 2009 13:42

Firewall-autorun

Post by gledof » Wed Feb 11, 2009 3:30

Hello, I use:
# sudo update-rc.d firewall.sh defaults (iptables script in the following folder: /etc/init.d)
for autorun firewall script when the system start up. In Sbayon4, I cant did it. I found many differences in the sintaxys regarding others Linux. Can you help me with the wright command?

wolfden
Sharecropper
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA
Contact:

Re: Firewall-autorun

Post by wolfden » Wed Feb 11, 2009 6:28

See:
http://www.gentoo.org/doc/en/home-router-howto.xml

It has section there on iptables

curse
Simple Hen
Posts: 53
Joined: Tue Jul 03, 2007 13:15
Location: Gran Canaria
Contact:

Re: Firewall-autorun

Post by curse » Wed Feb 11, 2009 12:13

first, Sabayon is Gentoo based, not Debian based as Ubuntu, so the syntax is a bit different.
personally I prefer to su, and be root when I'm fixing stuff instead of the endless typing of sudo they do over in the Ubuntu camp.. though, that really doesn't matter.. the command you're looking for in this case is

Code: Select all

rc-update firewall.sh default

User avatar
zambayoni
Young Hen
Posts: 33
Joined: Sun Dec 28, 2008 23:46
Contact:

Re: Firewall-autorun

Post by zambayoni » Wed Feb 11, 2009 21:10

i have a similiar problem. When super user:

Code: Select all

#rc-update firewall.sh default
rc-update: service `firewall.sh' does not exist


In firewall.sh :

Code: Select all

guarddog


I installed guarddog firewall.

gledof
Young Hen
Posts: 31
Joined: Thu Jan 29, 2009 13:42

Re: Firewall-autorun

Post by gledof » Thu Feb 12, 2009 1:08

You copied firewall script in the "/etc/init.d" folder? and gave it chmod +x?

gledof
Young Hen
Posts: 31
Joined: Thu Jan 29, 2009 13:42

Re: Firewall-autorun SOLVED

Post by gledof » Thu Feb 12, 2009 1:16

Curse, thank for the tip, of course I did it like a root, but I dont no why type "sudo". Tell me, there are a page where I can get a list of command for Gentoo (Sabayon) ?

User avatar
zambayoni
Young Hen
Posts: 33
Joined: Sun Dec 28, 2008 23:46
Contact:

Re: Firewall-autorun

Post by zambayoni » Thu Feb 12, 2009 15:04

gledof wrote:You copied firewall script in the "/etc/init.d" folder? and gave it chmod +x?


Yes, the script have the permissions to run, and is in the folder /etc/init.d. I can't do rc-update :?

User avatar
zambayoni
Young Hen
Posts: 33
Joined: Sun Dec 28, 2008 23:46
Contact:

Re: Firewall-autorun Solved reg service but problm with guarddog

Post by zambayoni » Thu Feb 12, 2009 16:48

I solved how register one service.

My problem was a bad script init.

I created /etc/init.d/firewall : (i look http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4 and cupsd script)

Code: Select all

#!/sbin/runscript

depend() {
   use net
}

start() {
   ebegin "Starting guarddog firewall ..."
   start-stop-daemon --start --quiet --exec /usr/bin/guarddog
   eend $?
}

stop() {
   ebegin "Stopping guarddog firewall ..."
   start-stop-daemon --stop --quiet --exec /usr/bin/guarddog
   eend $?
}


next do a rc.update_

Code: Select all

 # rc-update add firewall default
 * firewall added to runlevel default


and response.!!! :D

If you remove a service, select option del for rc-update.

All is beautiful, but i have a small problem. When i rebooting, the firewall not starting.

Checking the script in terminal (super user):

Code: Select all

 # /etc/init.d/firewall start
firewall             | * Starting guarddog firewall ... ...              [ !! ]
firewall             | * ERROR: firewall failed to start


My problem is the script or is the guarddog. It becuase guarddog is for KDE and suspect that work only in graph mode and searching for some options, but not find. I recording that firewall firestarter had a script for executing like service, i don't know if will have one for guarddog. :?

PD: When in terminal:

Code: Select all

start-stop-daemon --start --quiet --exec /usr/bin/guarddog


this work, and guarddog window open.

User avatar
zambayoni
Young Hen
Posts: 33
Joined: Sun Dec 28, 2008 23:46
Contact:

Re: Firewall-autorun [Solved]

Post by zambayoni » Thu Feb 12, 2009 17:17

yes, i solved my self :D

In http://bugs.gentoo.org/182373 i found the correct script for /etc/init.d/firewall:

Code: Select all

#!/sbin/runscript 
 
 depend() {
          after iptables
     before ddclient
          }
 
 start() {
          ebegin "Applying firewall rules - Guarddog"
 
          /etc/rc.firewall
          eend $? "Firewall rules not set"
          }


And Work!!! :D

Guarddog change IPtables and generate script in /etc/rc.firewall

Thanks :mrgreen:

User avatar
zambayoni
Young Hen
Posts: 33
Joined: Sun Dec 28, 2008 23:46
Contact:

Re: Firewall-autorun

Post by zambayoni » Thu Feb 12, 2009 18:14


Post Reply