On Wed, 2004-12-15 at 10:55 -0600, Andy Wettstein wrote: > Hello > > We are running condor 6.6.7 on Scientific Linux 3 (which is really > rhel 3) and we have a problem with Condor not noticing keyboard/mouse > input when a workstation has X activity. If I ssh to the machine or > switch to the text console, Condor picks that up and suspends the job, > but with just X input the Condor jobs keep running. These machines use > the UWCS_* policy for starting and suspending jobs. Hi, I've run into this problem as well. The issue is that the atime of the /dev nodes which represent they keyboard and mouse devices is not being updated by the kernel when input occurs. The following kernel patch (based on [1] and made against 2.4.26) re-adds this functionality for devices using the kernel input device infrastructure -- mice, joysticks, but not keyboards. In practice, we've found that this is sufficient. Cheers, David [1] http://www.ussg.iu.edu/hypermail/linux/kernel/0406.1/1612.html -- David McBride <dwm@xxxxxxxxxxxx> Department of Computing, Imperial College, London
diff -u -r linux-2.4.26/drivers/input/evdev.c linux-2.4.26-dwm/drivers/input/evdev.c --- linux-2.4.26/drivers/input/evdev.c 2003-06-13 15:51:34.000000000 +0100 +++ linux-2.4.26-dwm/drivers/input/evdev.c 2004-10-07 15:22:17.000000000 +0100 @@ -203,6 +203,10 @@ retval += sizeof(struct input_event); } + /* [dwm] Update the atime of the /dev node to enable idle time calculations. */ + if (retval > 0) + file->f_dentry->d_inode->i_atime = CURRENT_TIME; + return retval; } diff -u -r linux-2.4.26/drivers/input/joydev.c linux-2.4.26-dwm/drivers/input/joydev.c --- linux-2.4.26/drivers/input/joydev.c 2003-06-13 15:51:34.000000000 +0100 +++ linux-2.4.26-dwm/drivers/input/joydev.c 2004-10-07 15:23:39.000000000 +0100 @@ -316,6 +316,10 @@ retval += sizeof(struct js_event); } + /* [dwm] Update the atime of the /dev node to enable idle time calculations. */ + if (retval > 0) + file->f_dentry->d_inode->i_atime = CURRENT_TIME; + return retval; } diff -u -r linux-2.4.26/drivers/input/mousedev.c linux-2.4.26-dwm/drivers/input/mousedev.c --- linux-2.4.26/drivers/input/mousedev.c 2003-06-13 15:51:34.000000000 +0100 +++ linux-2.4.26-dwm/drivers/input/mousedev.c 2004-10-07 15:26:18.000000000 +0100 @@ -380,6 +380,10 @@ list->buffer -= count; + /* [dwm] Update the atime of the /dev node to enable idle time calculations. */ + if (count > 0) + file->f_dentry->d_inode->i_atime = CURRENT_TIME; + return count; }
Attachment:
signature.asc
Description: This is a digitally signed message part