daemon monitoring

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Nov 16 03:05:28 EET 2007


On 2007-11-16 01:00, Thanasis <thanasis at asyr.hopto.org> wrote:
> while true; do ps -ef |grep pro[c]ess > /dev/null && sleep 100 || <run
> process> ; done
> πχ
>  while true; do ps -ef |grep na[m]ed > /dev/null && sleep 100 ||
> /usr/sbin/named -u named -n 1; done
> ή
> while true; do ps -ef |grep na[m]ed > /dev/null && sleep 100 ||
> /etc/init.d/named restart; done

Μπορείς να γεμίσεις το δίσκο σου με άχρηστα syslog messages και με πιο
απλό τρόπο:

	while true ; do \
	    logger 'named: cannot bind port 53' ; \
	    sleep 100 ; \
	done

Food for thought: Τι θα γίνει αν το `while ... ps ...' τρέξει την ώρα
που το ίδιο το named είναι στη φάση που ξεκινάει, αλλά δεν έχει κάνει
fork()/exec() ακόμα;

Το να προσπαθείς να γράψεις μια "χακιά πάνω από χακιά με σάλτσα
γλυκόξινης χακιάς" επειδή δεν σου αρέσει το inittab, δεν είναι πάντα
καλή ιδέα :-)




More information about the Linux-greek-users mailing list