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

Re: [HTCondor-users] Problems detecting mouse/keyboard with Fedora

Hi Michael,

wow, thanks for so comprehensive reply. We're mainly using KDE here, but maybe we can try a similar solution...


Quoting Michael V Pelletier <Michael.V.Pelletier@xxxxxxxxxxxx>:

I'm running Red Hat Enteprise Linux 6 here, and had a similar issue with
our workstations. I had tried running the kbdd as root, but since home
directories are on a root-squashed NFS filesystem, it wasn't able to read
the cookies for the users, and thus was unable to connect to the display
to monitor activity. I'm not sure if it'll be exactly what you need, but
hopefully it'll at least get you closer.

The trick in our case is that the condor_kbdd, in order to detect GNOME
console activity, has to be attached with the user's session, and owned by
the user. This is discussed in section 3.12.5 in the 8.2.9 manual, but it
is a bit short of explicit guidance due to the variety of different
platforms involved.

For the RHEL6 GNOME, you need to add an "htcondor-kbdd.sh" script to
/etc/X11/xinit/xinitrc.d to start it up on login, and update
/etc/gdm/PostSession/Default to shut it down on logout.

The gist of the htcondor-kbdd.sh file is:

if [ -x /usr/sbin/condor_kbdd ] ; then
        if [ -d $HOME/.kbdd.log ] ; then
                /bin/mv -f $HOME/.kbdd.log/KbdLog
                if [ -e $HOME/.kbdd.log ] ; then
                        /bin/rm -f $HOME/.kbdd.log
        /usr/sbin/condor_kbdd -l $HOME/.kbdd.log -pidfile $HOME/.kbdd.pid

This does some basic sanity checking as you can see, by rotating the log
file from a previous session and removing any non-directory that might
block the daemon's creation of the directory. The condor_kbdd drops into
the background by itself, so doesn't need an &.

The PostSession/Default script runs as root, and for obvious security
reasons condor_kbdd doesn't want to run as root, so you have to switch to
the session owner to run condor_kbdd -k to kill the daemon. So we have:

if [ -f "$HOME/.kbdd.pid" ] ; then
        /bin/su $USER -c \
                "/usr/sbin/condor_kbdd -k $HOME/.kbdd.pid ; /bin/rm -f

This approach is preferable to an OS kill because it allows the kbdd to
take itself down 100% gracefully, doing whatever updates it needs to do
before exiting.

After setting this up, the ConsoleIdle and KeyboardIdle attributes showed
the expected responses to keyboard and mouse activity.

More information on these /etc/gdm scripts are here:

It's probably possible to do everything under the /etc/gdm scripots, but
the fact that they run as root led me to use the xinitrc.d options instead
for startup, in alignment with the general recommendations in the manual.
Feel free to share anything you discover that might simplify things.

        -Michael Pelletier.

Dr. Antonio Dorta
Servicios InformÃticos EspecÃficos (SIE)
InvestigaciÃn y EnseÃanza
Instituto de AstrofÃsica de Canarias (IAC)
C/ VÃa LÃctea, s/n. 38205 - La Laguna, Santa Cruz de Tenerife
Despacho: 1508. Tfno: 922 60 5278. email: adorta@xxxxxx
Supercomputing at IAC: http://www.iac.es/sieinvens/SINFIN/Main/supercomputing.php
ADVERTENCIA: Sobre la privacidad y cumplimiento de la Ley de Proteccion de Datos, acceda a http://www.iac.es/disclaimer.php WARNING: For more information on privacy and fulfilment of the Law concerning the Protection of Data, consult http://www.iac.es/disclaimer.php?lang=en