Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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/ ?
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..
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 ?
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.