LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-06-2004, 02:12 PM   #1
hardknox
LQ Newbie
 
Registered: Oct 2004
Distribution: Debian
Posts: 23

Rep: Reputation: 15
init.d


Ok, so I'm using Debian, and I thought I had a basic grasp on how this whole process worked. I wrote a very simple shell script with 4 iptables commands, named it firewall.sh, put it in /etc/init.d, and made it executable. Then, I changed to my /etc/rc3.d folder and put a new link: "ln -s ../init.d/firewall.sh S99firewall". I was under the impression that the executables in the rc#.d folders would be executed during the appropriate run level. For some reason, the script isn't being ran. I put a "control" line in the bottom of the shell script: "mkdir /home/hardknox/test". This folder isn't being created which seems to confirm that this script isn't being ran.

BTW, this same process worked just find to issue the iwconfig commands on my laptop.

Basically at this point I have two questions.
1. Why isn't firewall.sh running during run level 3?
2. Is this the proper way to initialize the rules for iptables?

Thanks in advance,
Blake
 
Old 10-06-2004, 02:35 PM   #2
m00t00
Member
 
Registered: Sep 2004
Distribution: Slackware 10, Gentoo
Posts: 292

Rep: Reputation: 30
Dont think it is the proper way. Im pretty sure there is a file there already to do it, but for the life of me, I couldnt tell you what it is... Just try looking around there. If you cant figure it out, put the lines in wherever your net gets setup (and I wouldnt know that file either, I use bsd-style init scripts =]
 
Old 10-06-2004, 02:36 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
The default runlevel on debilian is 2, methynks ;)

That aside I believe that in deb iptables comes with
a script, already, called iptables (at least it exists on
the servers that I have access to).


Cheers,
Tink
 
Old 10-06-2004, 02:48 PM   #4
hardknox
LQ Newbie
 
Registered: Oct 2004
Distribution: Debian
Posts: 23

Original Poster
Rep: Reputation: 15
Can't find any script that's already there. I believe there is a file called rc.iptables that would do the trick, but it's not in the format of regular shell script.

I still can't figure out why my shell script in init.d isn't running.
 
Old 10-06-2004, 02:51 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Because the default runlevel is 2 and not 3?



Cheers,
Tink
 
Old 10-06-2004, 03:08 PM   #6
hardknox
LQ Newbie
 
Registered: Oct 2004
Distribution: Debian
Posts: 23

Original Poster
Rep: Reputation: 15
Ok, so putting the S99firewall link in rc2.d fixed the problem. I thought that my default run level was 5. In Core 2 if you set the run level to anything below 5 you didn't get a graphical login. Apparently that's not the case in debian. That would also explain why any scripts I have in run levels higher than 2 aren't executed because it's not going that high! So what's the difference between 2, 3, 4, and 5? If i set the run level to 5 does it run everything in rc1, rc2, rc3, rc4, AND rc5? or are those skipped?

What if there's a problem with the graphical login? I can't just lower the run level to 3 because it's in there too!
 
Old 10-06-2004, 03:30 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
There's still init 1 ...

And there's no point in arguing with me about
debilian's init-structure, I use Slack for a reason ;)



Cheers,
Tink
 
Old 10-06-2004, 03:35 PM   #8
hardknox
LQ Newbie
 
Registered: Oct 2004
Distribution: Debian
Posts: 23

Original Poster
Rep: Reputation: 15
ROFL, There's no arguement here. I'm asking cause I obviously don't understand.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Kernel Panic No init found. Try passing init..... Adrian Baker Mandriva 2 02-28-2005 11:47 AM
Redhat linux9.0:System hangs,if gives init 3 or init 4 Sailaja Reddy Linux - Newbie 4 09-16-2004 03:19 AM
Kernal Panic: No init found. Try passing init= option to kernel raees Linux - General 12 03-18-2004 11:10 PM
error: No init found. Try passing the init= option to the Kernel neylitalo Linux - Laptop and Netbook 3 01-22-2004 09:34 PM
error "Kernel panic: No init found. Try passing init= option Anauj0101 Linux - Newbie 3 05-06-2003 10:18 PM


All times are GMT -5. The time now is 08:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration