Hi all! I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it... -- /Rikard ------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
If you're worried about run levels, the best place for them would be in /etc/init.d, with the appropriate "S" links in the various rcx.d directories.
On Monday 04 October 2004 23:22, Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
On SuSE 9.1, this is described in: - man init.d (same as /etc/init.d/README) - /etc/init.d/skeleton Cheers, Leen
The 2004-10-05 at 00:01 +0200, Leendert Meyer wrote:
On SuSE 9.1, this is described in:
- man init.d (same as /etc/init.d/README) - /etc/init.d/skeleton
Plus the chapter "The SuSE boot concept" on the suse admin book, paper or otherwise. -- Cheers, Carlos Robinson
On Tuesday 05 October 2004 00.01, Leendert Meyer wrote:
On Monday 04 October 2004 23:22, Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
On SuSE 9.1, this is described in:
- man init.d (same as /etc/init.d/README) - /etc/init.d/skeleton
Cheers,
Leen I got so far. The S and K links is the place, but i cant understand how to change the skeleton. All i need is to run "jdsl -l" to login (and "jdsl -o" to logout) from the ADSL, and make sure no-ip runs after that. The last thing is the script (which loads a few iptables rules i need.)
-- /Rikard ------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
The 2004-10-05 at 01:55 +0200, Rikard Johnels wrote:
I got so far. The S and K links is the place, but i cant understand how to change the skeleton.
Don't modify the links, they will be deleted by Yast some time. Copy the skeleton file, modify as needed, install with chkconfig. -- Cheers, Carlos Robinson
On Monday 04 October 2004 9:17 pm, Carlos E. R. wrote:
The 2004-10-05 at 01:55 +0200, Rikard Johnels wrote:
I got so far. The S and K links is the place, but i cant understand how to change the skeleton.
Don't modify the links, they will be deleted by Yast some time.
Copy the skeleton file, modify as needed, install with chkconfig.
A very important -- and nonobvious -- piece of advice! Paul
On Tuesday 05 October 2004 01:55, Rikard Johnels wrote:
On Tuesday 05 October 2004 00.01, Leendert Meyer wrote:
On Monday 04 October 2004 23:22, Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
On SuSE 9.1, this is described in:
- man init.d (same as /etc/init.d/README) - /etc/init.d/skeleton
I got so far. The S and K links is the place, but i cant understand how to change the skeleton.
Hmm, perhaps I should have pointed out that the whole idea of SuSE's boot concept is to forget the S and K links. Read /etc/init.d/skeleton. The order of the scripts is controlled in the lines between: ### BEGIN INIT INFO and ### END INIT INFO And 'man insserv' can tell you more about it.
All i need is to run "jdsl -l" to login (and "jdsl -o" to logout) from the ADSL, and make sure no-ip runs after that. The last thing is the script (which loads a few iptables rules i need.)
First of all, I am unfamiliar with ADSL. But there is a YaST DSL module, did you already check it out? And second, no-ip implies that you don't have a permanent connection, do you? So to me it seems the better place for the no-ip binary would be in /etc/sysconfig/network/if-{up,down}.d/. Search e.g. in /sbin/ifup for if-up.d, and nearby you'll find how the scripts in if-{up,down}.d/ will be called (with which arguments). I guess you only want to execute the no-ip binary if the ADSL interface has been brought up (and perhaps right before it is brought down?). The second argument has the name of the interface, so if the interface name does not match that of the ADSL interface, there is nothing to be done. Cheers, Leen
On Tuesday 05 October 2004 04.17, Leendert Meyer wrote:
On Tuesday 05 October 2004 01:55, Rikard Johnels wrote:
On Tuesday 05 October 2004 00.01, Leendert Meyer wrote:
On Monday 04 October 2004 23:22, Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
On SuSE 9.1, this is described in:
- man init.d (same as /etc/init.d/README) - /etc/init.d/skeleton
I got so far. The S and K links is the place, but i cant understand how to change the skeleton.
Hmm, perhaps I should have pointed out that the whole idea of SuSE's boot concept is to forget the S and K links. Read /etc/init.d/skeleton. The order of the scripts is controlled in the lines between:
### BEGIN INIT INFO
and
### END INIT INFO
And 'man insserv' can tell you more about it.
All i need is to run "jdsl -l" to login (and "jdsl -o" to logout) from the ADSL, and make sure no-ip runs after that. The last thing is the script (which loads a few iptables rules i need.)
First of all, I am unfamiliar with ADSL. But there is a YaST DSL module, did you already check it out?
Yes. But this setup is for a standalone firewall with a bare minimum setup. My ADSL uses a plain network logon via a webpage. The jdsl just sends all the relevant info to the page for a login
And second, no-ip implies that you don't have a permanent connection, do you? So to me it seems the better place for the no-ip binary would be in /etc/sysconfig/network/if-{up,down}.d/.
It is "semi-permanent" Its a dhcp connection, but its up 24/7 so i tend to keep the ip for an extended period of time (last count over 300 days)
Search e.g. in /sbin/ifup for if-up.d, and nearby you'll find how the scripts in if-{up,down}.d/ will be called (with which arguments).
I guess you only want to execute the no-ip binary if the ADSL interface has been brought up (and perhaps right before it is brought down?). The second argument has the name of the interface, so if the interface name does not match that of the ADSL interface, there is nothing to be done.
Cheers,
Leen
-- /Rikard ------------------------------------------------------------------------------------ Rikard Johnels email : rikjoh@norweb.se Web : http://www.rikjoh.com Mob : +46 735 05 51 01 ------------------------ Public PGP fingerprint ---------------------------- < 15 28 DF 78 67 98 B2 16 1F D3 FD C5 59 D4 B6 78 46 1C EE 56 >
On Tuesday 05 October 2004 05:11, Rikard Johnels wrote:
On Tuesday 05 October 2004 04.17, Leendert Meyer wrote:
On Tuesday 05 October 2004 01:55, Rikard Johnels wrote:
On Tuesday 05 October 2004 00.01, Leendert Meyer wrote:
On Monday 04 October 2004 23:22, Rikard Johnels wrote:
Hi all!
I have two binaries, and one script i need to start right after network is up. (the ADSL login and no-ip client) How do i make sure those get started at boot and the right runlevels? I tried looking into the different boot.xx files but couldn't make too much out out of it...
... All i need is to run "jdsl -l" to login (and "jdsl -o" to logout) from the ADSL, and make sure no-ip runs after that. The last thing is the script (which loads a few iptables rules i need.)
First of all, I am unfamiliar with ADSL. But there is a YaST DSL module, did you already check it out?
Yes. But this setup is for a standalone firewall with a bare minimum setup. My ADSL uses a plain network logon via a webpage. The jdsl just sends all the relevant info to the page for a login
And second, no-ip implies that you don't have a permanent connection, do you? So to me it seems the better place for the no-ip binary would be in /etc/sysconfig/network/if-{up,down}.d/.
It is "semi-permanent" Its a dhcp connection, but its up 24/7 so i tend to keep the ip for an extended period of time (last count over 300 days)
Ok, I've thought this over a bit, and I think it is best to go to the if-{up,down}.d directories, because the binaries you use need to be run right after the link is up, and before other services make use of the connection. I think it would be difficult to insert an init.d script at the right place, without modification of other init.d scripts. It's quite simple. Here is a small template script: ----8<----[if-adsl.sh]----8<---- #! /bin/bash # script is called with these kind of arguments: # $1 = "eth-id-xx:xx:xx:xx:xx:xx" # $2 = "eth0" # $3 = "-o" # fill in your ADSL interface: INT="eth0" # Do nothing if the interface isn't right: [ "$2" != "$INT" ] && exit D="${0%/*}" D="${D##*/}" case $D in if-up.d) echo "Bringing interface $INT up..." # I'm guessing here: jdsl -l no-ip ;; if-down.d) echo "Bringing interface $INT down..." # I'm guessing here: no-ip jdsl -o ;; esac ---->8---->8---->8---->8---- Save this file as e.g. /usr/local/bin/if-adsl.sh then: $ F="/usr/local/bin/if-adsl.sh" $ chmod +x $F $ ln -s $F /etc/sysconfig/network/if-up.d/ $ ln -s $F /etc/sysconfig/network/if-down.d/ I've tested this setup on my own pc, and it seems to work well. Cheers, Leen
participants (5)
-
Carlos E. R.
-
James Knott
-
Leendert Meyer
-
Paul W. Abrahams
-
Rikard Johnels