Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Runscript starten wenn anderes Runscript läuft...
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1156
Location: Vienna (Austria)

PostPosted: Thu Sep 15, 2005 12:58 pm    Post subject: Runscript starten wenn anderes Runscript läuft... Reply with quote

Hallo zusammen!

Ich habe hier eine WG511T PCMCIA-Karte.
Ifplugd sorgt dafür das mein WLAN schön mit Hotplug funktioniert (Karte rein / Karte raus)...

Nun ist es so, das ich gewisse dienste nach dem einstecken der Karte starten möchte.
Wie z. Bsp. der NTP-Client oder irgendwelche Samba-mounts.
Gibts das was vom aktuellen baselayout aus, oder sonsst wo?

Also das Problem ist ja so, dass das WLAN nicht beim Systemstart gestartet wird sondern eben durch das eionstecken der Karte. Und erst wenn das passiert sollen Dienste wie samba oder NTP-Client gestartet werden.

Das würde den Boot ohne Karte beschleunigen und echt nur dann gewisse (und vorallem sinnvoll / erfolgreich) starten, wenn es angesagt ist.
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1156
Location: Vienna (Austria)

PostPosted: Fri Sep 16, 2005 6:11 pm    Post subject: Reply with quote

*bump* ... kommt schon Leute, einer von euch weiß das sicher...
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
dertobi123
Retired Dev
Retired Dev


Joined: 19 Nov 2002
Posts: 2679
Location: Oberhausen, Germany

PostPosted: Sat Sep 17, 2005 8:25 am    Post subject: Reply with quote

Zumindest zum Starten der Dienste sollte es reichen das WLAN-Init-Skript auf die verschiedenen anderen Dienste dependen zu lassen.
Back to top
View user's profile Send private message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1156
Location: Vienna (Austria)

PostPosted: Sat Sep 17, 2005 8:27 pm    Post subject: Reply with quote

Du meinst das ich in NTP-Client Init-Script net.ath0 als Abhängigkeit eintrage?
Aber das heißt dann, wenn ntp-client im Runlevel ist, das es zu starten versucht, aber nicht kann weil net.ath0 nicht läuft oder?
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1156
Location: Vienna (Austria)

PostPosted: Mon Oct 10, 2005 3:07 pm    Post subject: Reply with quote

>>>boing<<< --> das Thema ist noch immer aktuell ;)
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Mon Oct 10, 2005 4:38 pm    Post subject: Reply with quote

Mir fallen spontan zwei Möglichkeiten ein:

Du erstellst ein neues Runlevel, in dem net.ath0 sowie samba, ntpclient etc. enthalten sind. ifplugd konfigurierst du dann so, dass er die Runlevel passend wechselt. Das hat den Nachteil, dass die Verwaltung zweier Runlevel etwas aufwändiger ist - wenn du ein neues Initskript hinzufügen willst, muss es beiden Runlevels hinzugefügt werden, oder es wird dauernd gestartet/gestoppt.

Die andere Möglichkeit wäre, ein eigenes Initskript zu erstellen mit dynamischer depend() Funktion. Ich glaube, dass das unterstützt wird. Das Initskript hängt dann bei eingesteckter Karte von samba, ntpclient, net.ath0 etc ab und andernfalls von nichts. ifplugd konfigurierst du so, dass es das Initskript neu startet, wenn die Karte eingesteckt wird. Auf diese Weise musst du keine Gentoo-eigenen Initskripte verändern, was bei Aktualisierungen viel Aufwand spart. Das ganze geht wie gesagt nur, wenn depend() dynamisch sein darf. Wegen caching etc. wird das evtl. nicht unterstützt, schau am besten mal in ein paar Initskripte rein, ob irgendeines dynamisch need bzw. use berechnet.
_________________
KDE
Back to top
View user's profile Send private message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1156
Location: Vienna (Austria)

PostPosted: Tue Oct 11, 2005 6:19 am    Post subject: Reply with quote

Hm die Ansätze sin schon mal sehr gut :)

Also ich werde noch schauen ob es sowas wie dynamische Abhängigkeiten gibt, aber ich befürchte auch das das nicht der Fall sein wird.
Hm. Aber dann wäre das jetzt ja ein Ideale verbesserungsvorschlag für Gentoo oder nicht? ;)

Andererseits könnte ich vielleicht auch die Entwickler von ifplugd kontaktieren, ob sie so eine Funktion nicht mit einbauen könnten.

Und dann bleibt da natürlich immer noch das selber machen (Script / Runlevel wie auch immer).
Ich denke das wird auch das einzige sein was mir übrig bleibt.

Aber thx für die Idee ;)
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
schmutzfinger
Veteran
Veteran


Joined: 26 Oct 2003
Posts: 1287
Location: Dresden/Germany

PostPosted: Tue Oct 11, 2005 8:49 am    Post subject: Reply with quote

Imho sollte das ganz einfach in /etc/conf.d/net postup() eingetragen werden. Und das umount der shares dann ins predown().
Back to top
View user's profile Send private message
Earthwings
Bodhisattva
Bodhisattva


Joined: 14 Apr 2003
Posts: 7753
Location: Germany

PostPosted: Tue Oct 11, 2005 9:30 am    Post subject: Reply with quote

schmutzfinger wrote:
Imho sollte das ganz einfach in /etc/conf.d/net postup() eingetragen werden. Und das umount der shares dann ins predown().

Dann startest du aber Initskripte, die nicht im aktuellen Runlevel sind. Was dazu führt, das ein Ausführen von "rc" sie wieder beendet.

@NightDragon: Es gibt einige Initskripte, die depend() abhängig vom Systemzustand berechnen, z.B.
/etc/init.d/netmount wrote:
Code:
        local nfsmounts=$(awk '!/^#/ && ($3=="nfs" || $3=="nfs4") && $4 !~ /noauto/ { print $0 }' /etc/fstab)

        if [ -n "${nfsmounts}" ]
        then
                myneed="${myneed} portmap"
                myuse="${myuse} nfs nfsmount"
        fi

        need ${myneed}
        use ${myuse}

Ich würds mal ausprobieren.
_________________
KDE
Back to top
View user's profile Send private message
NightDragon
Veteran
Veteran


Joined: 21 Aug 2004
Posts: 1156
Location: Vienna (Austria)

PostPosted: Tue Oct 11, 2005 10:15 am    Post subject: Reply with quote

Mensch Earthwings... ich war vor einigen Wochen in KA...
ich hätte dich auch persönlich fragen können ;)

Danke für die Info... ich schaus mir an wenn ich Feirabend habe.
_________________
You are the problem too all my solutions ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum