Dämonen

Status
Für weitere Antworten geschlossen.

itari

Benutzer
Mitglied seit
15. Mai 2008
Beiträge
21.900
Punkte für Reaktionen
14
Punkte
0
Dämonen (engl. daemons) sind die im Hintergrund ablaufenden Programme. Microsoft nennt sie "Dienste" - ich nenne sie "Server". Mit ps kann man sie sich natürlich auch alle ansehen, aber man sieht nicht so recht, wie sie gestartet wurden und wie sie zusammengehören.

Wer möchte, kann sich eine Web-Darstellung für seinen Disk-Station-Manager zusammen basteln. Sie ist als 3rd-party-application ähnlich wie die zur Systeminformation einzubauen.

Das .cgi-Skript sieht wie folgt aus:

Rich (BBCode):
#!/bin/ash
cat <<EOT
Content-type: text/html

<html><head><title>test</title></head><body><table>
<style>pre,td{padding-right:2px;padding-left:2px;vertical-align:top;
font:11px Courier New;background-color:#ccf}</style>
EOT
for f in /usr/syno/etc/rc.d/* ; do
case ${f##*/} in
S02*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep hotplugd|grep -v grep; echo "</pre></td></tr>" ;;
S03i*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep inetd|grep -v grep; echo "</pre></td></tr>" ;;
S04*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep crond|grep -v grep; echo "</pre></td></tr>" ;;
S09*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep ddnsd|grep -v grep; echo "</pre></td></tr>" ;;
S20*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep postgres|egrep -v '(grep|download|photo)'; 
echo "</pre></td></tr>" ;;
S21*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep mysql|grep -v grep; echo "</pre></td></tr>" ;;
S25*) echo "<tr><td>${f##*/}</td><td><pre>";ps|egrep '(scemd|scheduler|download|rtorrent)'|grep -v grep; 
echo "</pre></td></tr>" ;;
S55*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep lpd|grep -v grep; echo "</pre></td></tr>" ;;
S66*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep synoindexd|grep -v grep; echo "</pre></td></tr>" ;;
S77*) echo "<tr><td>${f##*/}</td><td><pre>";ps|egrep '(thumb|photo|convert)'|grep -v grep; 
echo "</pre></td></tr>" ;;
S80*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep smbd|grep -v grep; echo "</pre></td></tr>" ;;
S81*) echo "<tr><td>${f##*/}</td><td><pre>";ps|egrep '(atalkd|afpd|papd)'|grep -v grep; 
echo "</pre></td></tr>" ;;
S83*) echo "<tr><td>${f##*/}</td><td><pre>";
ps|egrep '(portmap|nsfd|\[lockd|rpciod|mountd)'|grep -v grep; 
echo "</pre></td></tr>" ;;
S84*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep rsync|grep -v grep; echo "</pre></td></tr>" ;;
S85*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep synonetbkpd|grep -v grep; echo "</pre></td></tr>" ;;
S86*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep dms|grep -v grep; 
echo "</pre></td></tr>" ;;
S88*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep synomkflvd|grep -v grep; 
echo "</pre></td></tr>" ;;
S95*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep sshd|grep -v grep; 
echo "</pre></td></tr>" ;;
S96*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep synorcd|grep -v grep; 
echo "</pre></td></tr>" ;;
S97apache-sys*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep 'DSSL -f'|grep -v grep; 
echo "</pre></td></tr>" ;;
S97apache-user*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep DSSL|egrep -v '(grep|-f)'; 
echo "</pre></td></tr>" ;;
S98*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep findhostd|grep -v grep; 
echo "</pre></td></tr>" ;;
S99f*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep ftpd|grep -v grep;
echo "</pre></td></tr>" ;;
S99i*) echo "<tr><td>${f##*/}</td><td><pre>";ps|grep mt-daapd|grep -v grep; 
echo "</pre></td></tr>" ;;
esac
eche "</div>"
done

Die Leerzeile (Zeile 4) ist wichtig und muss sein!!!
 

Anhänge

  • deamons.jpg
    deamons.jpg
    109,1 KB · Aufrufe: 153
Status
Für weitere Antworten geschlossen.
 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat