Page 1 of 1
shell - testen, ob bestimmtes programm läuft
Posted: 2003-03-29 14:39
by flofri
Hi!
Ich habe mal eine frage, ist es möglich per shell-script herauszufinden, ob ein bestimmtes Programm läuft (in meinem fall httpd, mysqld, ...) und wenn ja, wie?
MfG
FloFri
Re: shell - testen, ob bestimmtes programm läuft
Posted: 2003-03-29 15:37
by majortermi
Wenn "grep" erfolgreich ist, läuft das entsprechende Programm.
Besser: Startskript benutzen und PID-File auslesen (so machen das die Skript in init.d).
Re: shell - testen, ob bestimmtes programm läuft
Posted: 2003-03-29 15:56
by kase
Code: Select all
echo "Es laufen `ps ax | grep httpd | grep -v grep | wc -l` httpd Prozesse und `ps ax | grep mysql | grep -v grep | wc -l` mySQL Prozesse"
Falls es ein Debian System ist, musst du httpd durch apache ersetzen.
Edit: Vorsicht, kein Zeilenumbruch !
Re: shell - testen, ob bestimmtes programm läuft
Posted: 2003-03-29 16:22
by flofri
danke!