LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-11-2010, 03:25 AM   #1
shukalo83
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
Finding out what startup script did what


Hello everyone.

When I log in redhat4 box iptables -vL give me about 20 to 30 lines of output. Somebody else before me administered the box. Is there a way for me to know what startup script he used to run the iptables on startup. He certainly didn't use iptables-save/restore. Is there a way to run services one by one, being logged with ssh by putting, for example this:

(
/bin/sleep 10
/sbin/ifconfig eth0 192.168.2.10 up
/usr/sbin/sshd
) > /dev/null 2>&1 &

in /etc/rc.S file and checking consequences of each service or startup script?
 
Old 09-11-2010, 04:29 AM   #2
anon237
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Maybe this will help: Red Hat Enterprise Linux 4: Reference Guide - Chapter 18. iptables

After a quick scan I do believe your questions are answered in 18.4. Saving iptables Rules and beyond.

Hope this helps.
 
Old 09-11-2010, 04:36 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627Reputation: 3627
And in addition to what's been said already:
Quote:
Originally Posted by shukalo83 View Post
When I log in redhat4 box iptables -vL give me about 20 to 30 lines of output.
That's because you should run '/etc(/rc.d)/init.d/iptables status' or 'service iptables status' or something distro-agnostic like 'cat /proc/net/ip_tables_names | xargs -iT /sbin/iptables -t 'T' -xvnL'.


Quote:
Originally Posted by shukalo83 View Post
Somebody else before me administered the box. Is there a way for me to know what startup script he used to run the iptables on startup. He certainly didn't use iptables-save/restore.
While iptables rules may be loaded in different ways (rc.local, cron @reboot, you name it) by default iptables should be a service in etc/rc.d/init.d/ so best just first check what 'rpm -q iptables' (is it installed?), 'rpm -Vv iptables' (have package contents been modified?) and 'chkconfig --list iptables' (is the service enabled?) return before grepping recursively through the /etc/init.d directory for clues.


Quote:
Originally Posted by shukalo83 View Post
Is there a way to run services one by one (..) in /etc/rc.S file and checking consequences of each service or startup script?
The /etc/rc.d/rc.S equivalent would be /etc/rc.d/rc.local IIRC but wrt standards compliance and management-wise services are best started by using existing service files (networking, SSH) or creating one.
 
  


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
Finding the startup process swethas Linux - Kernel 4 11-06-2006 03:10 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 09:40 PM
Not finding my wireless card on startup soaked Linux - Wireless Networking 7 07-21-2005 08:25 AM
Finding a shell script une Linux - General 2 01-26-2005 01:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:55 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