* Start Up Script
@ 2003-03-02 18:43 Brian Bunnell
2003-03-06 15:55 ` James A. Pattie
0 siblings, 1 reply; 21+ messages in thread
From: Brian Bunnell @ 2003-03-02 18:43 UTC (permalink / raw)
To: netfilter
Hello
Thank you very much for helping me. I have a perfectly good netfilter
script that I run from the command line and everything works fine. I would
like this script to run when I boot up the computer. I am having a lot of
trouble finding quality resources on the net about this.
There are great resources for learning how to use netfilter. However, when
it comes to startup scripts, all the examples seem to be 25 pages long and
incomprehensible or wnat me to completely rewrite the script I already have.
Why can't I just tell the computer to run my script instead of the "Let the
world in" script it runs at boot?
Does anyone have any recommendations, resources or better yet, a good
concise example for run level 3?
Thank you very much
Brian Bunnell
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/03
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Start Up Script
2003-03-02 18:43 Start Up Script Brian Bunnell
@ 2003-03-06 15:55 ` James A. Pattie
2003-03-06 17:36 ` Arnt Karlsen
0 siblings, 1 reply; 21+ messages in thread
From: James A. Pattie @ 2003-03-06 15:55 UTC (permalink / raw)
To: Brian Bunnell; +Cc: netfilter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brian Bunnell wrote:
> Hello
>
> Thank you very much for helping me. I have a perfectly good netfilter
> script that I run from the command line and everything works fine. I
would
> like this script to run when I boot up the computer. I am having a lot of
> trouble finding quality resources on the net about this.
>
> There are great resources for learning how to use netfilter. However,
when
> it comes to startup scripts, all the examples seem to be 25 pages long and
> incomprehensible or wnat me to completely rewrite the script I already
have.
>
> Why can't I just tell the computer to run my script instead of the
"Let the
> world in" script it runs at boot?
>
> Does anyone have any recommendations, resources or better yet, a good
> concise example for run level 3?
If you are on a chkconfig/sysv system just add the necessary chkconfig
entries to the top of your script, drop it in /etc/init.d and chkconfig
{script name} on. Make sure you disable the iptables scripts if on a
redhat box.
The PCX Firewall project will generate a redhat init script.
http://pcxfirewall.sf.net/ Use that for examples on how to modify your
script.
- --
James A. Pattie
james@pcxperience.com
Linux -- SysAdmin / Programmer
Xperience, Inc.
http://www.pcxperience.com/
http://www.xperienceinc.com/
GPG Key Available at http://www.pcxperience.com/gpgkeys/james.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+Z29xtUXjwPIRLVERAph1AKCm9hDscA7l/fgnoVf2vg5TvzGVngCfRdGJ
tWrFpueX8wJ4AVpZ7Jw+MC0=
=mimX
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: Start Up Script
2003-03-06 15:55 ` James A. Pattie
@ 2003-03-06 17:36 ` Arnt Karlsen
0 siblings, 0 replies; 21+ messages in thread
From: Arnt Karlsen @ 2003-03-06 17:36 UTC (permalink / raw)
To: netfilter
On Thu, 06 Mar 2003 09:55:30 -0600,
"James A. Pattie" <james@pcxperience.com> wrote in message
<3E676F72.1060702@pcxperience.com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Brian Bunnell wrote:
> > Hello
> >
> > Thank you very much for helping me. I have a perfectly good
> > netfilter script that I run from the command line and everything
> > works fine. I
> would
> > like this script to run when I boot up the computer. I am having a
> > lot of trouble finding quality resources on the net about this.
> >
> > There are great resources for learning how to use netfilter.
> > However,
> when
> > it comes to startup scripts, all the examples seem to be 25 pages
> > long and incomprehensible or wnat me to completely rewrite the
> > script I already
> have.
> >
> > Why can't I just tell the computer to run my script instead of the
> "Let the
> > world in" script it runs at boot?
> >
> > Does anyone have any recommendations, resources or better yet, a
> > good concise example for run level 3?
>
> If you are on a chkconfig/sysv system just add the necessary chkconfig
> entries to the top of your script, drop it in /etc/init.d and
> chkconfig{script name} on. Make sure you disable the iptables scripts
> if on a redhat box.
>
> The PCX Firewall project will generate a redhat init script.
> http://pcxfirewall.sf.net/ Use that for examples on how to modify
> your script.
..the classic bsd approach is move your script to /etc/rc.d/rc.firewall
and call it from /etc/rc.d/rc.local, just before rc.local runs you
online at boot time.
--
..med vennlig hilsen = with Kind Regards from Arnt... ;-)
...with a number of polar bear hunters in his ancestry...
Scenarios always come in sets of three:
best case, worst case, and just in case.
^ permalink raw reply [flat|nested] 21+ messages in thread
* start up script
@ 2004-03-06 10:43 Ravi Kumar Munnangi
2004-03-06 12:00 ` John Kelly
` (2 more replies)
0 siblings, 3 replies; 21+ messages in thread
From: Ravi Kumar Munnangi @ 2004-03-06 10:43 UTC (permalink / raw)
To: linux-newbie
Users,
Iam working in a LAN with a number of systems.
A system has X hardware address and another has Y
hardware address.
I want to set the hardware address of the second
system
also to X.
I also want to set the primary IP addresses of both
systems to 172.31.19.30.
So when I ping to 172.31.19.30, both the systems
should respond.
The topology of LAN we are using is star. All
systems
are connected to a Switch.
Does the settings change when we are using a bus
topology?
Do I have to write a start up script?
How should I write?
My actual goal is to start 2 web servers on two
systems with same hardware address and same
primary IP address but with different secondary
IP addresses. So when a request comes from a
client, the request has to be seen by both
systems. I will write some mechanism by which only
one will respond finally.
Please help!
Thanks in advance,
ravikumar
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2004-03-06 10:43 start up script Ravi Kumar Munnangi
@ 2004-03-06 12:00 ` John Kelly
2004-03-06 17:12 ` Ray Olszewski
2004-03-09 14:09 ` Stephen Samuel
2 siblings, 0 replies; 21+ messages in thread
From: John Kelly @ 2004-03-06 12:00 UTC (permalink / raw)
To: linux-newbie
Hi,
On Sat, 6 Mar 2004 02:43:03 -0800 (PST)
Ravi Kumar Munnangi <munnangi_ivar@yahoo.com> wrote:
> Users,
>
> Iam working in a LAN with a number of systems.
> A system has X hardware address and another has Y
> hardware address.
> I want to set the hardware address of the second
> system
> also to X.
> I also want to set the primary IP addresses of both
> systems to 172.31.19.30.
> So when I ping to 172.31.19.30, both the systems
> should respond.
>
> The topology of LAN we are using is star. All
> systems
> are connected to a Switch.
> Does the settings change when we are using a bus
> topology?
First up I don't think you should be doing this. having two systems with the same
hardware address on a LAN is going to break things in 'interesting' ways. ARP requests
are not likely to work as you expect and the switch is likely to get very confused if
it has the same hardware address answering on two different ports.
But then maybe I am wrong.
For what it is worth, here is an extract from the ifconfig man page:
===================================================================
hw class address
Set the hardware address of this interface, if the device driver supports this
operation. The keyword must be followed by the name of the hardware class and
the printable ASCII equivalent of the hardware address. Hardware classes cur-
rently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom
(AMPR NET/ROM).
====================================================================
So if the hardware supports it, ifconfig can do it.
> My actual goal is to start 2 web servers on two
> systems with same hardware address and same
> primary IP address but with different secondary
> IP addresses. So when a request comes from a
> client, the request has to be seen by both
> systems. I will write some mechanism by which only
> one will respond finally.
To me it sounds like you want some kind of load balancing mechanism.
If it is really necessary for both systems to see a packet, then some form
of forwarding might be what you need.
Hope this helps.
regards,
John Kelly
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2004-03-06 10:43 start up script Ravi Kumar Munnangi
2004-03-06 12:00 ` John Kelly
@ 2004-03-06 17:12 ` Ray Olszewski
2004-03-09 14:09 ` Stephen Samuel
2 siblings, 0 replies; 21+ messages in thread
From: Ray Olszewski @ 2004-03-06 17:12 UTC (permalink / raw)
To: linux-newbie
As someone else already noted, this idea is not as straightforward as you
might think it is. Offhand, I cannot think of a situation in which it is a
good solution. But you know your actual problem better than I do, so let me
tell you what I can about your questions, and leave it to you to decide.
At 02:43 AM 3/6/2004 -0800, Ravi Kumar Munnangi wrote:
>Users,
>
> Iam working in a LAN with a number of systems.
> A system has X hardware address and another has Y
>hardware address.
> I want to set the hardware address of the second
>system
> also to X.
OK. Whether you can do this or not is a hardware issue ... some NICs
support it, but others do not. In any case, read the man page for
"ifconfig" (or maybe "ip", if your system does not use ifconfig) to see the
Linux part of this.
> I also want to set the primary IP addresses of both
> systems to 172.31.19.30.
OK. As you probably already know, you do this the same way you would set
the machine to ANY IP address. The exact details are a bit distro
spcecific, and you don't mention which Linux distro you are using ... you
may use "ifconfig" directly, "ip" directly, or "ifup" in conjunction with a
config file (usually /etc/network/interfaces).
> So when I ping to 172.31.19.30, both the systems
> should respond.
Yes, because ping is pretty good at handling multiple addresses, and icmp
is "connectionless". Whether more complex and TCP-based protocols like http
will also work in this setup is less clear to me ... I'd wonder if anyone
has ever tried it (except as an accidental misconfiguration).
> The topology of LAN we are using is star. All
>systems
> are connected to a Switch.
> Does the settings change when we are using a bus
> topology?
Probably not ... but I am not certain what you mean by "bus" in this
context. Are you referring to some sort of ring network (like an old-style
thinnet LAN)?
> Do I have to write a start up script?
> How should I write?
These are distro-level questions ... and to some extent kernel level. Post
a followup with the usual details on your setup ... what distro, what
version, what kernel version, what NICs and modules ... and I or someones
else might be able to answer this one.
> My actual goal is to start 2 web servers on two
> systems with same hardware address and same
> primary IP address but with different secondary
> IP addresses. So when a request comes from a
> client, the request has to be seen by both
> systems. I will write some mechanism by which only
> one will respond finally.
Before you spend too much time on this approach, you want to think through
the "some mechanism" piece. Hand waving won't do here, and I don't see a
sensible way to create a mechanism that will work.
My best *guess* is that you want to do one of two things --
1. Load balance -- in normal operation, have each server handle
roughly half of the traffic.
2. Failover -- in normal operation, have one server handle all of
the traffic, but have the second ready and waiting to "hot swap" in if the
first should fail.
Either of these needs can be achieved in other, more conventional ways than
what you propose to try. The details depend on the content of the Web site
... how much of it is dynamically generated, and how it is generated, how
often its static content changes, how you intend to keep the two machines'
versions of the Website in sync, and the like ... and may involve a third
host (or even a fourth, if a large, shared database is involved).
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2004-03-06 10:43 start up script Ravi Kumar Munnangi
2004-03-06 12:00 ` John Kelly
2004-03-06 17:12 ` Ray Olszewski
@ 2004-03-09 14:09 ` Stephen Samuel
2 siblings, 0 replies; 21+ messages in thread
From: Stephen Samuel @ 2004-03-09 14:09 UTC (permalink / raw)
To: Ravi Kumar Munnangi; +Cc: linux-newbie
Ravi Kumar Munnangi wrote:
> Users,
>
> Iam working in a LAN with a number of systems.
> A system has X hardware address and another has Y
> hardware address.
> I want to set the hardware address of the second
> system
> also to X.
ifconfig eth0 hw ether 00:56:BA:A4:81:02
> I also want to set the primary IP addresses of both
> systems to 172.31.19.30.
> So when I ping to 172.31.19.30, both the systems
> should respond.
ifconfig eth0 172.31.19.30 [[ may want to set netmask/BC]]
>
> The topology of LAN we are using is star. All
> systems
> are connected to a Switch.
> Does the settings change when we are using a bus
> topology?
Some switches may get confused by having the same
MAC address on two ports... In somes cases, it may
only send a packet to one fo the machines (usually
the last one to use that MAC address))
>
> Do I have to write a start up script?
> How should I write?
Write a regular shell script and then put it in
the proper place. If you have proper rc2.d
script directories, then you can put it near the
SNNnetwork scripts
For RedHat, that would be /etc/rc.d/rc[2345].d/S10network
so you could try S09
Otherwise, put it in the r.local file for those kinds of systems.
Setting the MAC addr needs to be done *BEFORE* you
bring the card up. (or you need to bring it down).
(under Linux)
For RedHat systems, however, you can use the MACADDR=
variable in /etc/sysconfig/network-scripts/ifcfg-eth0
and IPADDR=
The RH scripts do the rest.
For the person who said that some cards don't support this,
I would say that that is very rare to nonexistent..
the MAC address needs to be softwar settable for
things like prosxy arp and bridgng... In 17 years
of playing with ethernet, Idon't rememember *ever* seeing
a card that you couldn't set the MAC address on.
> My actual goal is to start 2 web servers on two
> systems with same hardware address and same
> primary IP address but with different secondary
> IP addresses. So when a request comes from a
> client, the request has to be seen by both
> systems. I will write some mechanism by which only
> one will respond finally.
--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication. Transformation touching
the jewel within each person and bringing it to light.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Start Up Script
@ 2003-03-06 15:28 Carol Anne Ogdin
0 siblings, 0 replies; 21+ messages in thread
From: Carol Anne Ogdin @ 2003-03-06 15:28 UTC (permalink / raw)
To: Brian Bunnell; +Cc: netfilter
[-- Attachment #1: Type: text/plain, Size: 2229 bytes --]
I put a collection of bash scripts (containing all my iptables and ip and
other configuration commands) in a unique directory that I can use at
bootup. I have a shorter bash script that invokes those specific bash
scrips from the startup process.
Specifically, at /etc/rc.d/rc2.d/ (and at .../rc3.d/..., .../rc4.d/... and
.../rc5.d/...) I have a script named S11dwt that contains the following
commands:
#!/bin/bash
pushd . &>/dev/null
cd /etc/sysconfig/network-scripts/DWT
bash Kernel
bash Firewall
bash NICs
bash Routes
popd &>/dev/null
The four referenced scripts set certain Kernel configuration parameters,
setup the Firewall iptables chains, enable the NICs, and then establish
the Routes.
Hope this helps...most Linux documentation is written for people who
already know how to do things, so it can be hard to ferret out simple
things like this.
--Carol Anne
Carol Anne Ogdin
http://www.net-working.com
530/295-3657
Deep Woods Technology, Inc.
http://www.deepwoods.com
CAOgdin@deepwoods.com
Leveraging technology to restore the soul of the organization
Message: 2
From: "Brian Bunnell" <bbunnell@iastate.edu>
To: <netfilter@lists.netfilter.org>
Subject: Start Up Script
Date: Sun, 2 Mar 2003 12:43:02 -0600
Hello
Thank you very much for helping me. I have a perfectly good netfilter
script that I run from the command line and everything works fine. I
would
like this script to run when I boot up the computer. I am having a lot of
trouble finding quality resources on the net about this.
There are great resources for learning how to use netfilter. However,
when
it comes to startup scripts, all the examples seem to be 25 pages long and
incomprehensible or wnat me to completely rewrite the script I already
have.
Why can't I just tell the computer to run my script instead of the "Let
the
world in" script it runs at boot?
Does anyone have any recommendations, resources or better yet, a good
concise example for run level 3?
Thank you very much
Brian Bunnell
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/03
[-- Attachment #2: Type: text/html, Size: 3764 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* start up script
@ 2003-02-11 23:05 - Luis -
2003-02-12 6:35 ` Leonid Mamtchenkov
` (3 more replies)
0 siblings, 4 replies; 21+ messages in thread
From: - Luis - @ 2003-02-11 23:05 UTC (permalink / raw)
To: linux admin
Hi all, i want to add a script to the start up in my Red Hat box, but i
already put the file in /etc/rc.d/init.d and make the symbolic link in
/etc/rc3.d/S55routetable.
But still doesn't work, if i run the script manually, it runs just fine, but
when i restart the server i doesn't run.
Basically the script is for adding some routes to my server.
Thanks
--
Luis Valencia
------------------------
With a PC, I always felt limited
by the software available.
On Unix, I am limited only by my knowledge.
--Peter J. Schoenster
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-11 23:05 start up script - Luis -
@ 2003-02-12 6:35 ` Leonid Mamtchenkov
2003-02-12 7:23 ` Glynn Clements
` (2 subsequent siblings)
3 siblings, 0 replies; 21+ messages in thread
From: Leonid Mamtchenkov @ 2003-02-12 6:35 UTC (permalink / raw)
To: linux-kernel
- Luis - <unix@amigo.net.gt> wrote:
L> Hi all, i want to add a script to the start up in my Red Hat box, but i
L> already put the file in /etc/rc.d/init.d and make the symbolic link in
L> /etc/rc3.d/S55routetable.
L>
L> But still doesn't work, if i run the script manually, it runs just fine,
L> but when i restart the server i doesn't run.
You might want to try using chkconfig(8) instead of manually creating
symlinks.
L> Basically the script is for adding some routes to my server.
You can add static routes by editing /etc/sysconfig/static-routes. The
format of the file is 1 route definition per line. Route definition
looks like:
eth0 net 10.5.10.0 netmask 255.255.255.0 gw 10.5.17.1
HTH.
--
Best regards,
Leonid Mamtchenkov, RHCE
System Administrator
Francoudi & Stephanou Ltd.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-11 23:05 start up script - Luis -
2003-02-12 6:35 ` Leonid Mamtchenkov
@ 2003-02-12 7:23 ` Glynn Clements
2003-02-12 8:35 ` freddie
2003-02-12 11:24 ` terry white
3 siblings, 0 replies; 21+ messages in thread
From: Glynn Clements @ 2003-02-12 7:23 UTC (permalink / raw)
To: - Luis -; +Cc: linux admin
- Luis - wrote:
> Hi all, i want to add a script to the start up in my Red Hat box, but i
> already put the file in /etc/rc.d/init.d and make the symbolic link in
> /etc/rc3.d/S55routetable.
It should probably be "/etc/rc.d/rc3.d/S55routetable".
> But still doesn't work, if i run the script manually, it runs just fine, but
> when i restart the server i doesn't run.
Is the script relying upon environment settings which are only present
in an interactive shell? Scripts which are run from init tend to have
a relatively empty environment; e.g. PATH may not contain /sbin or
/usr/sbin, etc.
Does the script work if you use e.g.
env -i /etc/rc.d/init.d/routetable start
?
--
Glynn Clements <glynn.clements@virgin.net>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: start up script
2003-02-11 23:05 start up script - Luis -
2003-02-12 6:35 ` Leonid Mamtchenkov
2003-02-12 7:23 ` Glynn Clements
@ 2003-02-12 8:35 ` freddie
2003-02-12 11:24 ` terry white
3 siblings, 0 replies; 21+ messages in thread
From: freddie @ 2003-02-12 8:35 UTC (permalink / raw)
To: - Luis -; +Cc: linux admin
does your script start with #!/bin/bash (or equivalent)?
also use full paths. for example in your script "sed blahblahblah" will
work when you run it by hand but not during boot. "/usr/sbin/sed
balhblahblah" would work for both.
when you run something manually you have your whole environment set up.
when a script is run during bootup it doesnt.
> Hi all, i want to add a script to the start up in my Red Hat box, but
> i
> already put the file in /etc/rc.d/init.d and make the symbolic link in
>
> /etc/rc3.d/S55routetable.
>
> But still doesn't work, if i run the script manually, it runs just
> fine, but
> when i restart the server i doesn't run.
>
> Basically the script is for adding some routes to my server.
>
> Thanks
> --
> Luis Valencia
> ------------------------
> With a PC, I always felt limited
> by the software available.
> On Unix, I am limited only by my knowledge.
> --Peter J. Schoenster
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: start up script
2003-02-11 23:05 start up script - Luis -
` (2 preceding siblings ...)
2003-02-12 8:35 ` freddie
@ 2003-02-12 11:24 ` terry white
2003-02-12 14:38 ` - Luis -
3 siblings, 1 reply; 21+ messages in thread
From: terry white @ 2003-02-12 11:24 UTC (permalink / raw)
To: linux-admin
on "2-11-2003" "- Luis -" writ:
: Hi all, i want to add a script to the start up in my Red Hat box, but i
: already put the file in /etc/rc.d/init.d and make the symbolic link in
: /etc/rc3.d/S55routetable.
:
: But still doesn't work, if i run the script manually, it runs just fine, but
: when i restart the server i doesn't run.
... did you use 'chkconfig' to enable it ...
--
... i'm a man, but i can change,
if i have to , i guess ...
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-12 11:24 ` terry white
@ 2003-02-12 14:38 ` - Luis -
2003-02-12 15:33 ` Scott Taylor
` (3 more replies)
0 siblings, 4 replies; 21+ messages in thread
From: - Luis - @ 2003-02-12 14:38 UTC (permalink / raw)
To: linux-admin
This is my script:
#!/bin/bash
/sbin/route add -net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
/sbin/route add -net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
/sbin/route add -net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
and its place in /etc/rc.d/init.d/routetable and the link its in
/etc/rc.d/rc3.d/S55routetable
but i run it only executing /etc/rc.d/init.d/routetable as root
how does it work chkconfig? or do i have to place this script in somewhere
else?
Thanks
On Wednesday 12 February 2003 05:24, terry white wrote:
> on "2-11-2003" "- Luis -" writ:
> : Hi all, i want to add a script to the start up in my Red Hat box, but i
> : already put the file in /etc/rc.d/init.d and make the symbolic link in
> : /etc/rc3.d/S55routetable.
> :
> : But still doesn't work, if i run the script manually, it runs just fine,
> : but when i restart the server i doesn't run.
>
> ... did you use 'chkconfig' to enable it ...
--
Luis Valencia
------------------------
With a PC, I always felt limited
by the software available.
On Unix, I am limited only by my knowledge.
--Peter J. Schoenster
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-12 14:38 ` - Luis -
@ 2003-02-12 15:33 ` Scott Taylor
2003-02-12 17:45 ` - Luis -
2003-02-12 16:07 ` terry white
` (2 subsequent siblings)
3 siblings, 1 reply; 21+ messages in thread
From: Scott Taylor @ 2003-02-12 15:33 UTC (permalink / raw)
To: linux-admin
At 06:38 AM 2/12/03, - Luis - wrote:
>This is my script:
>
>#!/bin/bash
>/sbin/route add -net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
>/sbin/route add -net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
>/sbin/route add -net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
>
>and its place in /etc/rc.d/init.d/routetable and the link its in
>/etc/rc.d/rc3.d/S55routetable
There is more to writing a startup script than that.
>but i run it only executing /etc/rc.d/init.d/routetable as root
I don't think it should make a difference at this point, unless your
network isn't running by S55. Are you sure you are starting only at run
level 3?
>how does it work chkconfig? or do i have to place this script in somewhere
>else?
man chkconfig
It's a very handy tool for administering run level services.
Didn't you say you were running a RedHat box? Version number would be
useful information, however, check to see if you have the file:
/etc/sysconfig/static-routes
in it, add the line:
eth0 net 10.0.0.0 netmask 255.0.0.0 gw 10.1.1.250
>As long as eth0 is the NIC connected to 10.1.1.250
/etc/init.d/network script reads this file for you, and does it in the
right place, and the next person to admin this RedHat box will know where
to look with out a bunch of fumbling around.
Good luck.
Scott.
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-12 15:33 ` Scott Taylor
@ 2003-02-12 17:45 ` - Luis -
2003-02-12 18:09 ` Jeff Largent
0 siblings, 1 reply; 21+ messages in thread
From: - Luis - @ 2003-02-12 17:45 UTC (permalink / raw)
To: linux admin
Thanks Scott, that static-routes file will make my day, but i look in
/etc/sysconfig and is not there, can i just create one and restart the
network services, or is more complicated than that?
On Wednesday 12 February 2003 09:33, Scott Taylor wrote:
> At 06:38 AM 2/12/03, - Luis - wrote:
> >This is my script:
> >
> >#!/bin/bash
> >/sbin/route add -net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
> >/sbin/route add -net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
> >/sbin/route add -net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
> >
> >and its place in /etc/rc.d/init.d/routetable and the link its in
> >/etc/rc.d/rc3.d/S55routetable
>
> There is more to writing a startup script than that.
>
> >but i run it only executing /etc/rc.d/init.d/routetable as root
>
> I don't think it should make a difference at this point, unless your
> network isn't running by S55. Are you sure you are starting only at run
> level 3?
>
> >how does it work chkconfig? or do i have to place this script in somewhere
> >else?
>
> man chkconfig
> It's a very handy tool for administering run level services.
>
> Didn't you say you were running a RedHat box? Version number would be
> useful information, however, check to see if you have the file:
> /etc/sysconfig/static-routes
>
> in it, add the line:
> eth0 net 10.0.0.0 netmask 255.0.0.0 gw 10.1.1.250
>
> >As long as eth0 is the NIC connected to 10.1.1.250
>
> /etc/init.d/network script reads this file for you, and does it in the
> right place, and the next person to admin this RedHat box will know where
> to look with out a bunch of fumbling around.
>
> Good luck.
>
> Scott.
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Luis Valencia
------------------------
With a PC, I always felt limited
by the software available.
On Unix, I am limited only by my knowledge.
--Peter J. Schoenster
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: start up script
2003-02-12 17:45 ` - Luis -
@ 2003-02-12 18:09 ` Jeff Largent
2003-02-12 18:29 ` - Luis -
0 siblings, 1 reply; 21+ messages in thread
From: Jeff Largent @ 2003-02-12 18:09 UTC (permalink / raw)
To: - Luis -; +Cc: linux admin
The static-routes file based on your route statements would look
like:
eth0 net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
ech0 net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
eth0 net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
the answer is yes if the file dosn't exist create it and
just restart network "service network restart"
Jeff
- Luis - wrote:
> Thanks Scott, that static-routes file will make my day, but i look in
> /etc/sysconfig and is not there, can i just create one and restart the
> network services, or is more complicated than that?
>
>
> On Wednesday 12 February 2003 09:33, Scott Taylor wrote:
>
>>At 06:38 AM 2/12/03, - Luis - wrote:
>>
>>>This is my script:
>>>
>>>#!/bin/bash
>>>/sbin/route add -net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
>>>/sbin/route add -net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
>>>/sbin/route add -net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
>>>
>>>and its place in /etc/rc.d/init.d/routetable and the link its in
>>>/etc/rc.d/rc3.d/S55routetable
>>
>>There is more to writing a startup script than that.
>>
>>
>>>but i run it only executing /etc/rc.d/init.d/routetable as root
>>
>>I don't think it should make a difference at this point, unless your
>>network isn't running by S55. Are you sure you are starting only at run
>>level 3?
>>
>>
>>>how does it work chkconfig? or do i have to place this script in somewhere
>>>else?
>>
>>man chkconfig
>>It's a very handy tool for administering run level services.
>>
>>Didn't you say you were running a RedHat box? Version number would be
>>useful information, however, check to see if you have the file:
>> /etc/sysconfig/static-routes
>>
>>in it, add the line:
>>eth0 net 10.0.0.0 netmask 255.0.0.0 gw 10.1.1.250
>>
>>
>>>As long as eth0 is the NIC connected to 10.1.1.250
>>
>>/etc/init.d/network script reads this file for you, and does it in the
>>right place, and the next person to admin this RedHat box will know where
>>to look with out a bunch of fumbling around.
>>
>>Good luck.
>>
>>Scott.
>>
>>
>>-
>>To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>>the body of a message to majordomo@vger.kernel.org
>>More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Jeff Largent ImageLinks, Inc.
Sr System Admin Melbourne, Fl 32935
(321) 253-0011 fax:(321) 253-5559
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: start up script
2003-02-12 18:09 ` Jeff Largent
@ 2003-02-12 18:29 ` - Luis -
0 siblings, 0 replies; 21+ messages in thread
From: - Luis - @ 2003-02-12 18:29 UTC (permalink / raw)
To: linux admin
Thanks, that solve my problem
On Wednesday 12 February 2003 12:09, you wrote:
> The static-routes file based on your route statements would look
> like:
> eth0 net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
> ech0 net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
> eth0 net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
>
> the answer is yes if the file dosn't exist create it and
> just restart network "service network restart"
>
> Jeff
>
> - Luis - wrote:
> > Thanks Scott, that static-routes file will make my day, but i look in
> > /etc/sysconfig and is not there, can i just create one and restart the
> > network services, or is more complicated than that?
> >
> > On Wednesday 12 February 2003 09:33, Scott Taylor wrote:
> >>At 06:38 AM 2/12/03, - Luis - wrote:
> >>>This is my script:
> >>>
> >>>#!/bin/bash
> >>>/sbin/route add -net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
> >>>/sbin/route add -net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
> >>>/sbin/route add -net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
> >>>
> >>>and its place in /etc/rc.d/init.d/routetable and the link its in
> >>>/etc/rc.d/rc3.d/S55routetable
> >>
> >>There is more to writing a startup script than that.
> >>
> >>>but i run it only executing /etc/rc.d/init.d/routetable as root
> >>
> >>I don't think it should make a difference at this point, unless your
> >>network isn't running by S55. Are you sure you are starting only at run
> >>level 3?
> >>
> >>>how does it work chkconfig? or do i have to place this script in
> >>> somewhere else?
> >>
> >>man chkconfig
> >>It's a very handy tool for administering run level services.
> >>
> >>Didn't you say you were running a RedHat box? Version number would be
> >>useful information, however, check to see if you have the file:
> >> /etc/sysconfig/static-routes
> >>
> >>in it, add the line:
> >>eth0 net 10.0.0.0 netmask 255.0.0.0 gw 10.1.1.250
> >>
> >>>As long as eth0 is the NIC connected to 10.1.1.250
> >>
> >>/etc/init.d/network script reads this file for you, and does it in the
> >>right place, and the next person to admin this RedHat box will know where
> >>to look with out a bunch of fumbling around.
> >>
> >>Good luck.
> >>
> >>Scott.
> >>
> >>
> >>-
> >>To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> >>the body of a message to majordomo@vger.kernel.org
> >>More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Luis Valencia
------------------------
With a PC, I always felt limited
by the software available.
On Unix, I am limited only by my knowledge.
--Peter J. Schoenster
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: start up script
2003-02-12 14:38 ` - Luis -
2003-02-12 15:33 ` Scott Taylor
@ 2003-02-12 16:07 ` terry white
2003-02-12 22:14 ` Glynn Clements
2003-02-12 22:21 ` Andrew B. Cramer
3 siblings, 0 replies; 21+ messages in thread
From: terry white @ 2003-02-12 16:07 UTC (permalink / raw)
To: linux-admin
... ciao:
"man chkconfig" is the first thing to do.
basically, chkconfig manages services when the runlevel changes. it
requires a file for each service it manages, and that file has a specific
format. that format is defined (RH at least) in 'sysvinitfiles'. a
"locate sysvinitfiles" should point you in the right direction. the file
makes a handy template, for the cut-n-paste advocate.
given your preference, the file you create will be called
'routetable', and "chkconfig --add routetable" should handle all the
housekeeping chores. however, the file supports a 'case' statement
allowing several possible invocations, and it is your responsibility to
provide for the ones you use. specifically, you might well consider
using a 'route -del blah' to remove routes you've created when the
interface comes down.
: the link its in /etc/rc.d/rc3.d/S55routetable
i'd rm that before you invoke chkconfig on 'routetable' ...
--
... i'm a man, but i can change,
if i have to , i guess ...
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-12 14:38 ` - Luis -
2003-02-12 15:33 ` Scott Taylor
2003-02-12 16:07 ` terry white
@ 2003-02-12 22:14 ` Glynn Clements
2003-02-12 22:21 ` Andrew B. Cramer
3 siblings, 0 replies; 21+ messages in thread
From: Glynn Clements @ 2003-02-12 22:14 UTC (permalink / raw)
To: - Luis -; +Cc: linux-admin
- Luis - wrote:
> how does it work chkconfig? or do i have to place this script in somewhere
> else?
chkconfig just adds and removes the symlinks. It relies upon the
script having a line like this:
# chkconfig: 2345 05 92
near the top of the script.
The first field ("2345") is the default list of runlevels for which
that script will be run. The second field is the start order, and
the third is the stop order (i.e. the numbers in the "S" and "K"
symlinks respectively).
chkconfig is just for convenience. You don't have to use chkconfig;
creating the symlink manually will work just as well.
--
Glynn Clements <glynn.clements@virgin.net>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: start up script
2003-02-12 14:38 ` - Luis -
` (2 preceding siblings ...)
2003-02-12 22:14 ` Glynn Clements
@ 2003-02-12 22:21 ` Andrew B. Cramer
3 siblings, 0 replies; 21+ messages in thread
From: Andrew B. Cramer @ 2003-02-12 22:21 UTC (permalink / raw)
To: - Luis -, linux-admin
Hi,
I use this, and call it rc.myroutes. It's for 2 network cards.
Running Slackware.
#! /bin/sh
/sbin/route add -net 192.168.0.128 gw 192.168.0.130 netmask
255.255.255.128
/sbin/route add -net 192.168.0.0 gw 192.168.0.1 netmask
255.255.255.128
#
Best - Andrew
On 12 Feb 2003 at 8:38, - Luis - wrote:
> This is my script:
>
> #!/bin/bash
> /sbin/route add -net 10.3.1.0 netmask 255.255.255.0 gw 10.1.1.250
> /sbin/route add -net 10.4.1.0 netmask 255.255.255.0 gw 10.1.1.250
> /sbin/route add -net 10.8.1.0 netmask 255.255.255.0 gw 10.1.1.250
>
> and its place in /etc/rc.d/init.d/routetable and the link its in
> /etc/rc.d/rc3.d/S55routetable
>
> but i run it only executing /etc/rc.d/init.d/routetable as root
>
> how does it work chkconfig? or do i have to place this script in somewhere
> else?
>
> Thanks
>
> On Wednesday 12 February 2003 05:24, terry white wrote:
> > on "2-11-2003" "- Luis -" writ:
> > : Hi all, i want to add a script to the start up in my Red Hat box, but i
> > : already put the file in /etc/rc.d/init.d and make the symbolic link in
> > : /etc/rc3.d/S55routetable.
> > :
> > : But still doesn't work, if i run the script manually, it runs just fine,
> > : but when i restart the server i doesn't run.
> >
> > ... did you use 'chkconfig' to enable it ...
>
> --
> Luis Valencia
> ------------------------
> With a PC, I always felt limited
> by the software available.
> On Unix, I am limited only by my knowledge.
> --Peter J. Schoenster
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2004-03-09 14:09 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-02 18:43 Start Up Script Brian Bunnell
2003-03-06 15:55 ` James A. Pattie
2003-03-06 17:36 ` Arnt Karlsen
-- strict thread matches above, loose matches on Subject: below --
2004-03-06 10:43 start up script Ravi Kumar Munnangi
2004-03-06 12:00 ` John Kelly
2004-03-06 17:12 ` Ray Olszewski
2004-03-09 14:09 ` Stephen Samuel
2003-03-06 15:28 Start Up Script Carol Anne Ogdin
2003-02-11 23:05 start up script - Luis -
2003-02-12 6:35 ` Leonid Mamtchenkov
2003-02-12 7:23 ` Glynn Clements
2003-02-12 8:35 ` freddie
2003-02-12 11:24 ` terry white
2003-02-12 14:38 ` - Luis -
2003-02-12 15:33 ` Scott Taylor
2003-02-12 17:45 ` - Luis -
2003-02-12 18:09 ` Jeff Largent
2003-02-12 18:29 ` - Luis -
2003-02-12 16:07 ` terry white
2003-02-12 22:14 ` Glynn Clements
2003-02-12 22:21 ` Andrew B. Cramer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.