/etc/init.d/heartbeat status calls  heartbeat -s

for non root users this worked fine before 2.1.x (in etch 2.0.7) it returned 
the same value for root and non-root users

After 2.1.x it returns :

"heartbeat is stopped. No process"

even tho its wrong.

The pid file access rights are still the same

ls -la /var/run/heartbeat.pid
-rw-r--r-- 1 root root 11 2009-02-12 11:47 /var/run/heartbeat.pid

it seems an additional check has been added to cl_pidfile.c, previously only 

long            running_hb_pid =  cl_read_pidfile(PIDFILE);

was called - i.e. only the value of the pidfile - without verifying if the pid 
was running at all.

The additional check is propbably this:

if (CL_KILL(pid, 0) < 0 && errno == ESRCH) {
                goto bail;
        }

this calls kill -s 0 HEARTBEAT_PID

which returns 

 kill: (HEARTBEAT_PID) - Operation not permitted

which is not verified at all in the cl_pidfile.c.

The above check should be changed, using signal 0 requires permission as root 
user.

But, it should be possible to query if the process is running without an issue 
- since ps aux as non-root user also returns if a process is running.

The main issue is, that programs which interpret heartbeat status are wrongly 
led that heartbeat isnt running.



      
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to