You are not logged in.

#1 2006-05-04 01:22:49

Galdona
Member
Registered: 2006-03-15
Posts: 196

possible to background pair of daemons synchronously?

what i mean is, can i do something like this in the daemons array in rc.conf or elsewhere:

(...network @(adsl firestarter) @nvidia....)

so that the daemons adsl and firestarter, *as a pair*, will be backgrounded during startup, but where firestarter will only start loading after adsl has loaded (which takes about 10 secs). i use firestarter for nat, but nat doesnt work if adsl and firestarter are async in daemons array.

currently i have
... adsl @firestarter ....

would be nice if this is implemented in rc.conf...

Offline

#2 2006-05-04 01:25:12

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: possible to background pair of daemons synchronously?

That's a severe complication - as far as I know, you shouldn't have to be connected to start network daemons... I know sshd starts fine before network.

Offline

#3 2006-05-04 03:32:59

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: possible to background pair of daemons synchronously?

Why not background both adsl and firestarter, and put

/etc/rc.d/firestarter restart

in /etc/ppp/ip-up ?

Offline

#4 2006-05-04 05:00:05

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

hey thanks, i didnt know about that. but should it not just be "/etc/rc.d/firestarter start" in ip-up, and no firestarter in daemons array? but i guess makes no difference from user's POV.

Offline

#5 2006-05-04 17:07:55

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: possible to background pair of daemons synchronously?

Galdona wrote:

hey thanks, i didnt know about that. but should it not just be "/etc/rc.d/firestarter start" in ip-up, and no firestarter in daemons array? but i guess makes no difference from user's POV.

No, because if you lose your connection (lose sync, etc.), ip-up will be run again when you reconnect.

You could stop your firewall from /etc/ppp/ip-down if you want, but actually it's better to just restart your firewall from ip-up and leave the firewall in the rc.conf DAEMONS array -- you generally want to have your firewall on all the time so there's no window of opportunity between connection and firewall up.

If you want to be really paranoid, you should really start your firewall (NOT backgrounded) in rc.conf BEFORE adsl.

Offline

#6 2006-05-05 05:32:59

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

ok, i have gained more understanding smile

Offline

#7 2006-05-07 16:29:08

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

loserMcloser wrote:

Why not background both adsl and firestarter, and put

/etc/rc.d/firestarter restart

in /etc/ppp/ip-up ?

it actually does not work, and im back to manually restarting firestarter whenever the connection drops. does the adsl daemon call ip-up? adsl daemon is part of the roaring penguin pppoe package.

i tried manually restarting with "/etc/rc.d/adsl restart". i also tried pppoe-stop, pppoe-start. same effect, the firewall stops and does not go back up.

Offline

#8 2006-05-07 17:32:18

colnago
Member
From: Victoria, BC
Registered: 2004-03-25
Posts: 438

Re: possible to background pair of daemons synchronously?

You could combine them into one daemon.

Offline

#9 2006-05-07 20:44:57

Blaasvis
Member
Registered: 2003-01-17
Posts: 467

Re: possible to background pair of daemons synchronously?

try adding to firestarter:
        ck_daemon adsl && /etc/rc.d/adsl start

and remove adsl from the daemons array.


Freedom is what i love

Offline

#10 2006-05-08 04:56:53

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

eh? how do i combine them into one daemon?

Blaasvis smile, where do i add that line? i also start firestarter in daemons array.

the firestarter docs say that firestarter needs to be loaded after the network interface (in this case, ppp0) is already up, so im looking for a way to restart firestarter whenever the connection drops and then gets reconnected.

there is an option for just that in firestarter itself, but it doesnt work either; the firestarter docs also say that it might not work in all cases...

Offline

#11 2006-05-08 07:52:27

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: possible to background pair of daemons synchronously?

Galdona wrote:

eh? how do i combine them into one daemon?

Go check your adsl daemon script in /etc/rc.d/adsl. Observe it. Open the firestarter daemon in another terminal. Now create a new daemon in /etc/rc.d which combines both. It's quite obvious howto when observing the existing scripts.

Offline

#12 2006-05-08 11:26:23

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: possible to background pair of daemons synchronously?

/etc/rc.d/adslfirestarter

#!/bin/bash
case "$1" in
  start)
    /etc/rc.d/adsl start
    /etc/rc.d/firestarter start
    ;;
  stop)
    /etc/rc.d/firestarter stop
    /etc/rc.d/adsl stop
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

That'd probably work.  tongue

Offline

#13 2006-05-08 11:36:20

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: possible to background pair of daemons synchronously?

alternatively you could just start them one by one.. is the difference really that much?

Offline

#14 2006-05-08 13:24:53

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

thanks for the tips very much, i didnt realize they were actually scripts that i could edit in a text editor... i will try that.

iphitus wrote:

alternatively you could just start them one by one.. is the difference really that much?

the problem is that i use firestarter to share internet with a second PC. whenever the connection drops firestarter disables itself, so that upon reconnection, second PC will no longer have internet access. anyone using second PC has to go to router PC to restart firestarter manually.

edit: im sorry, i guess my concerns have evolved from original topic. i was only initially concerned with reducing startup time, but now i have realized that the above is a problem as well, so...  :oops:

Offline

#15 2006-05-08 13:46:57

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

hmm, but the pppoe connection is set to automatically restore itself whenever it gets cut off from my isp. i guess it is currently impossible to get reconnection+firestarter-restart fully automated, because in the case of combining firestarter and adsl in one script, i will still have to call that combo-script manually.

i guess this is not a limitation if i just use iptables? i dont have to worry about NAT getting disabled?

Offline

#16 2006-05-08 14:10:32

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: possible to background pair of daemons synchronously?

(i guess maybe this thread should be moved to networking section)

newbie question:
in /etc/ppp/ip-up, do i need to add just

/etc/rc.d/firestarter restart

? nothing more, no "exit 0" or curly braces or whatever?

Offline

#17 2006-05-08 17:47:56

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: possible to background pair of daemons synchronously?

Galdona wrote:

it actually does not work, and im back to manually restarting firestarter whenever the connection drops. does the adsl daemon call ip-up? adsl daemon is part of the roaring penguin pppoe package.

i tried manually restarting with "/etc/rc.d/adsl restart". i also tried pppoe-stop, pppoe-start. same effect, the firewall stops and does not go back up.

what does manually doing a "/etc/rc.d/firestarter restart" do (while the firewall is up and working)? it seems to me that this must be the problem, because I know for sure that pppoe calls /etc/ppp/ip-up when it gets an IP address -- I have DSL and use /etc/ppp/ip-up to do all sorts of things, one of which is restart my firewall (though I use shorewall, not firestarter).

if "/etc/rc.d/firestarter restart" does not work properly, you might need to file a bug report about it....

Offline

#18 2006-05-08 17:51:42

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: possible to background pair of daemons synchronously?

Galdona wrote:

(i guess maybe this thread should be moved to networking section)

newbie question:
in /etc/ppp/ip-up, do i need to add just

/etc/rc.d/firestarter restart

? nothing more, no "exit 0" or curly braces or whatever?

yes, that's right, though more traditional rc.* style would be

if [ -x /etc/rc.d/firestarter ]; then
  /etc/rc.d/firestarter restart
fi

No "exit 0" statement is needed in ip-up.

Offline

Board footer

Powered by FluxBB