Autor Beitrag
MagicTom
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

2000, XP Pro, 2003 Srv, 2003 SBS, Vista
D5, D7, D2005
BeitragVerfasst: Mo 25.08.08 13:07 
Hallo zusammen,
ich möchte gerne mehrere (z.B. 3 Stck) Serviceanwendungen auf einem Server installieren. Dann sollten zwei davon warten bis der dritte gestartet ist (DB mit Daten). Einzeln laufen alle Dienste perfekt, nur nach dem booten schießt es zwei von drei ab. Also sollte es so laufen das erst der wichtigste startet (DB) und dann alle anderen...

Habt Ihr eine Idee oder einen Denkanstoss für mich?

Vielen Dank
Thomas
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mo 25.08.08 13:11 
- Dienste haben "Abhängigkeiten". Ich weiß nun nicht, ob das nur die Installation betrifft, oder auch die Startreihenfolge.
- Dienste 1 und 2 "pollen" zyklisch (z.B. mit einer TCP Verbindung), ob Dienst 3 schon da ist. Wenn nicht, einfach abwarten, statt sich zu beenden.

_________________
PROGRAMMER: A device for converting coffee into software.
MagicTom Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

2000, XP Pro, 2003 Srv, 2003 SBS, Vista
D5, D7, D2005
BeitragVerfasst: Mo 25.08.08 14:19 
Danke für Deine Antwort!

Und genau diese Abhängigkeiten würde ich gerne nutze, denn wenn ich einfach nur warte:
ausblenden Delphi-Quelltext
1:
2:
3:
  if not ServiceRunning(nil'DBServer'then
    WaitFor(5000)
  else

dann bekomme ich Probleme nach der eingestellten Zeit.
Hat jemand eine Ahnung von den Abhängigkeiten?

Im voraus schon Vielen Dank!

Thomas

Moderiert von user profile iconNarses: Highlight- durch Delphi-Tags ersetzt
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Mo 25.08.08 15:15 
Wo ist das Problem mit ner Schleife zu warten
ausblenden Delphi-Quelltext
1:
while(ServiceRunning(nil'DBServer')!=true) do WaitFor(100);					

Damit wartet er doch bis der Dienst gestartet ist!?

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
MagicTom Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

2000, XP Pro, 2003 Srv, 2003 SBS, Vista
D5, D7, D2005
BeitragVerfasst: Mo 25.08.08 16:45 
Hallo,
das mit:
ausblenden Delphi-Quelltext
1:
while(ServiceRunning(nil'DBServer')!=true) do WaitFor(100);					

war nicht schlecht, allerdings benutze ich den Nexus DB Server und der möchte nur starten wenn ich einen Benutzernamen und Passwort bei den Eigenschaften hinterlege. Also startet der zweite Dienst nicht. Habt ihr noch weitere Vorschläge?

Natürlich könnte ich alles in eine Anwendung packen, aber dann bin ich nicht so flexibel. Wenn man ein Teil der Anwendung nicht läuft, kann man mal eben den Dienst neu starten, der Rest läuft weiter...

lg.
Thomas

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
MagicTom Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

2000, XP Pro, 2003 Srv, 2003 SBS, Vista
D5, D7, D2005
BeitragVerfasst: Mi 27.08.08 08:15 
Titel: Kurze Rückmeldung
Hallo an alle die geantwortet haben!

Ich habe nun folgendes gemacht:

ausblenden Delphi-Quelltext
1:
while(ServiceRunning(nil'DBServer')!=true) do WaitFor(100);					


eingefügt und beim Dienst die Abhängigkeiten mit dem nxDBServer hergestellt. Geht in der IDE.

Nun rennt alles wie gewünscht ;-)

Vielen Dank
Thomas
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mi 27.08.08 08:51 
Titel: Re: Kurze Rückmeldung
user profile iconMagicTom hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
while(ServiceRunning(nil'DBServer')!=true) do WaitFor(100);					


Sowas nimmt Delphi an? Merkwürdig.. ;)

_________________
PROGRAMMER: A device for converting coffee into software.
MagicTom Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

2000, XP Pro, 2003 Srv, 2003 SBS, Vista
D5, D7, D2005
BeitragVerfasst: Mi 27.08.08 12:47 
;-) natürlich nicht so :lol:

lg.
Tom