LinuxQuestions.org
Help answer threads with 0 replies.
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 02-25-2005, 10:18 AM   #76
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48

Great, well done

iptables is next..
It can be a pain coz the package and the custom version can be separate, but you need to be sure the command line finds the correct version.
My box has /sbin/iptables = old version & /usr/sbin/iptables = new version
When I do which -a iptables I get
gate:~# which -a iptables
/usr/sbin/iptables
/sbin/iptables

The PATH variable decides which one I get first..
PATH = PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11

This can be changed for a user in their .profile file..
Depending on how you access iptables, via su- or sudo, you will have to change at least root user's .profile and any others who need access to iptables.
The system default PATH is in /etc/profile
However, it may be even better if you can uninstall iptables.
Woody has dependency issues, yours may not..
Make a copy of /etc/init.d/iptables before uninstalling ..
This file needs to be edited to show the correct locations for iptables.

The locations are selected in the build commands for iptables.
do ./configure --help for the options.
If you can't uninstall the package you will need to specify a location that works with the PATH settings to find the new version first..
They have to be separate to stop a package upgrade from overwriting the custom ones..
And coz you've made a copy of /etc/init.d/iptables, the apt-get package upgrade scripts will ask which config file to use during upgrading.

Last edited by peter_robb; 02-25-2005 at 10:35 AM.
 
Old 02-25-2005, 10:38 AM   #77
wooshyFox
Member
 
Registered: Feb 2005
Distribution: debian sarge
Posts: 102

Original Poster
Rep: Reputation: 15
which version you want me to uninstall - the old one (got with apt-get which is 1.2.11 - can do an apt-get remove - *presume* you mean this one...?) or the new one (which is 1.3.0, which i downloaded and make'd - dont know how to install that one

confused as ever....
 
Old 02-25-2005, 10:42 AM   #78
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Oops, sorry, the package one, from apt-get..

apt-get remove iptables
 
Old 02-25-2005, 10:56 AM   #79
wooshyFox
Member
 
Registered: Feb 2005
Distribution: debian sarge
Posts: 102

Original Poster
Rep: Reputation: 15
ive uninstalled it - now the only version which remains is 1.3.0 .

when i type iptables i get:
/sbin/iptables: No such file or directory
...even tho if i type /usr/local/sbin/iptables
it runs.
should i put a symlink to it in /sbin/iptables/ ?
 
Old 02-25-2005, 11:01 AM   #80
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
What is your PATH setting?

set | grep PATH
 
Old 02-25-2005, 11:02 AM   #81
wooshyFox
Member
 
Registered: Feb 2005
Distribution: debian sarge
Posts: 102

Original Poster
Rep: Reputation: 15
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin
 
Old 02-25-2005, 11:06 AM   #82
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
And which -a iptables ?

I'm not aware of any caching system for filenames..
 
Old 02-25-2005, 11:11 AM   #83
wooshyFox
Member
 
Registered: Feb 2005
Distribution: debian sarge
Posts: 102

Original Poster
Rep: Reputation: 15
/usr/local/sbin/iptables
...wierd...
 
Old 02-25-2005, 11:19 AM   #84
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
That's sure strange..

Keep trying tho'
You can always copy the 3 files into /sbin..
Better to fix the PATH variable tho', put /usr/local/sbin first on the list..

What are you going to do for an iptables ruleset?
What I prefer is to have several scripts, but save them using the /etc/init.d/iptables save active (& inactive) options. And only use that for starting/stopping.
Usually when scripts start, they have a rule clearing section first to be sure only their rules exist.
Choice is open, but for me I get a known good script that I can turn on/off while playing with more complicated scripts from other tools..
 
Old 02-25-2005, 11:38 AM   #85
wooshyFox
Member
 
Registered: Feb 2005
Distribution: debian sarge
Posts: 102

Original Poster
Rep: Reputation: 15
am i being stoopid here (probably) - my PATH (after i su) is :
set | grep PATH
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin

...but if i look in /root/.profile it says:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X1

...and if i look in /etc/profile i get:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"

... which is what my PATH is before i su..

So where is the system getting my current PATH from ?
 
Old 02-25-2005, 11:42 AM   #86
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Depending on how you su..
either su or su -

You would carry your login environment with just su
and take the root environment with su -

So you would have a user's .profile in that user's home directory..

I just noticed that PATH is also being set in /etc/init.d/iptables
 
Old 02-25-2005, 12:03 PM   #87
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Didn't answer your question, did it..

I'm just looking through the startup scripts from initrd & inittab , /etc/rcS.d/* etc
and there are several PATH reassignments..
I would expect the last one, ie login would be the active one..
 
Old 02-25-2005, 12:11 PM   #88
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
In your /root/.profile do you have
export PATH after the PATH statement?
 
Old 02-25-2005, 12:20 PM   #89
wooshyFox
Member
 
Registered: Feb 2005
Distribution: debian sarge
Posts: 102

Original Poster
Rep: Reputation: 15
whoops sorry yeh - i did an su instead of an su - now I get /usr/local/sbin 1st and everything is hunky-dory
 
Old 02-25-2005, 12:23 PM   #90
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Ok, next is /etc/init.d/iptables..

Change the location of iptables to match 'which -a iptables'

Then some final checks and lilo..
 
  


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
iptables module config swmok Linux - Networking 3 04-17-2005 08:42 AM
trouble with iptables module wazilian Linux - Networking 0 09-24-2004 02:55 PM
trouble with iptables module wazilian Linux - Networking 0 09-24-2004 02:55 PM
iptables module error? hotrodowner Linux - Networking 1 04-02-2003 08:07 AM
IPTABLES module won't load TruckStuff Linux - General 1 05-10-2002 11:53 PM


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