[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to test threads for a service

From: Jaakko Heusala
Subject: Re: How to test threads for a service
Date: Tue, 10 Jan 2006 17:51:20 +0200 (EET)


On Tue, 10 Jan 2006, Jan-Henrik Haukeland wrote:

My only idea for now would be to use pid testing with exec to change symbolic links on filesystem to /proc/pid/status, so file content testing could be used to check /path/to/link with regex (at least on Linux 2.6.14). I don't really like this hack...

This is actually not a bad idea and a fine workaround in my book if I understood this correctly. Care to submit your setup to this list? This may be of interest to others.

Here it is but I am only testing it right now. Changing symbolic link seem to work well but I'm not sure does that file content match work as I intended.

Script can be found from It just changes the link.

The regex matches if there are more than 100 threads and then restarts mysql server. It also executes directly init.d-script. Is there better way to do that?

check process mysql with pidfile /var/run/mysqld/
    start program = "/etc/init.d/mysql start"
    stop program  = "/etc/init.d/mysql stop"
    if changed pid
        then exec "/usr/local/sbin/ /var/run/mysqld/ 
    if 3 restarts within 5 cycles then timeout
    group database

check file mysql-status with path /srv-proc/mysql/status
    start program = "/usr/local/sbin/ /var/run/mysqld/ 
    if match "^Threads:[^0-9]+[0-9]{3}" then
        exec "/etc/init.d/mysql restart"
    depends mysql

Jaakko H. Heusala
(08) 5566104 / 040 70 99 704

reply via email to

[Prev in Thread] Current Thread [Next in Thread]