LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-21-2006, 02:21 AM   #1
SBN
Member
 
Registered: Jul 2006
Distribution: UBUNTU, CentOS, FEDORA 8
Posts: 474

Rep: Reputation: 30
Symbolic link for Firestarter


- hey guys i have installed firestarter in my ubuntu desktop and i can run via its dektop icon, but i want it to run automatically upon boot. the firestarter (the "exe" file) is located in /usr/sbin directory and i tried to create a symbolic link for it using these commands:

Quote:
ln -s /usr/bin/firestarter /etc/rc2.d/S20firestarter
ln -s /usr/bin/firestarter /etc/rc3.d/S20firestarter
ln -s /usr/bin/firestarter /etc/rc4.d/S20firestarter
ln -s /usr/bin/firestarter /etc/rc5.d/S20firestarter
but theres already a file "S20firestarter" in rc2.d-rc5.d, why?

so i created a script with this codes:

Quote:
/usr/sbin/firestarter
and named it fire, and i copied fire into the /usr/sbin directory again use these commands:

Quote:
ln -s /usr/bin/fire /etc/rc2.d/S20fire
ln -s /usr/bin/fire /etc/rc3.d/S20fire
ln -s /usr/bin/fire /etc/rc4.d/S20fire
ln -s /usr/bin/fire /etc/rc5.d/S20fire
there were no errors but when i reboot my ubuntu firestarter wont automatically run.
 
Old 11-22-2006, 02:09 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
If I'm right, Firestarter is basically just a front-end for creating an iptables script. It means that iptables, which is the "Linux firewall", handles the firewall rules, but for it to work it needs the rules first fed to it; Firestarter is a graphical program which you use to create the rules, and once you "save" them (or whatever the program calls it), Firestarter creates a list of iptables commands which it runs, creating the appropriate iptables settings. Then it saves this file so that iptables uses these rules every time you boot your machine. So you don't have to run Firestarter all the time, just when you alter or create "a firewall", i.e. create the rules. After that you just save the configuration and Firestarter creates the file for iptables and that's it.

I'm not 100% sure about how it exactly works, since there are a few ways to achieve the result, but I could imagine that Firestarter without extra options just runs the program, which silently feeds iptables the rules. To get the graphical user interface you probably need to give it an extra option to get the program to show the UI, but that's not needed as I already said. If running plain Firestarter (without options, that is) produces no errors, it probably means that the program starts, gives iptables the instructions you created earlier and exits with exit code 0 (success). Therefore you don't need to create that extra startup script, the one existing should already do the job (it's in rc2.d-rc5.d because it is meant to be run at each runlevel from 2 to 5 -- runlevels 1 and 6 are for shutdown/reboot so they're not interesting in this case).

What does the already-existing Firestarter startup script have inside, have you looked at it?

Code:
more /etc/rc4.d/S20firestarter
My guess is that that just "takes the iptables rules in use" at every bootup, once you've created them first (one time only).

You don't actually need Firestarter if you're ok with iptables commands; you can just as well write a shell script that runs the appropriate iptables commands and either set it to be run at each bootup or use iptables-save to produce a file which you can then, for example, put in some place where you like to store your firewall config, and then make some startup script read it at bootup. That's what Firestarter does, except that it includes a "nice" interface too (in my opinion iptables' interface is just all right, it's got everything you need, nothing less and nothing more).

Iptables is in your kernel, and in addition to that you have the userspace tool called iptables which you use to configure the rules (iptables can do much more than just firewalling, by the way). Applications like Firestarter are just front-ends to iptables, not actual firewalls. Here's the process

Decide rules -> run iptables(userspace) to set them -> iptables(in kernel) uses them -> load them at boot

...and here's what happens with Firestarter:

Decide rules -> "create them" with Firestarter -> it runs iptables(userspace) to set them -> iptables(in kernel) uses them -> Firestarter created the script to load them at boot

As you can see, they're pretty much just the same. Except that I'm not sure if you can achieve everything with Firestarter that you could with iptables, but I might be wrong as well..

If I made some mistakes or wrong assumptions, please correct me, but I'm in the impression that this is the case. Some people have asked this same question earlier, and I think they were adviced not to run Firestarter during boot by themselves, it should handle the thing all by itself. You can check if it works like this: after bootup (without running Firestarter yourself) run, as root,

Code:
/sbin/iptables -L
If the firewall is clean, i.e. "turned off", you should just get ACCEPT rules for INPUT, OUTPUT and FORWARD and nothing more. If your firewall rules are set all right, they should be visible in the output.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbolic link? jasone Linux - Newbie 4 05-06-2005 07:55 AM
symbolic link ilnli Slackware 6 01-04-2005 05:05 PM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 10:01 AM
symbolic link jsetter Linux - Newbie 4 11-22-2004 07:18 AM
Symbolic link. bulzbb Linux - General 8 03-19-2004 04:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration