[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kdm and Xservers file (was: Re: bugs.kde.org offline due to kde
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2005-03-21 8:23:57
Message-ID: 20050321082357.GA2986 () ugly ! local
[Download RAW message or body]

On Mon, Mar 21, 2005 at 08:23:57AM +0100, Torsten Kasch wrote:
> On Sunday, 20. March 2005 19:25, you wrote:
> > the question is, how is the dm supposed to know that the file changed?
> > does the tool look for the xdm pid and hup it or does it rely on xdm's
> > auto-rescan on session exit?
> 
> It's done via HUPing the dm.
> 
ok, here is a wrapper script for kdm that acts as a signal proxy. it is
entirely untested, and the config merging facility (the +config option)
in kdm is missing, but you should get the idea.
the alternative would be of course patching kdm_config to read Xservers
again, but this seems complex, and it would be still unclean
(no auto-rescan of Xservers unless the old scheme would be completely
restored).

ah, i've got an even easier idea ... use a wrapper script, but for
kdm_config, not for kdm - this saves the signal relaying and having the
additional shell in memory all the time. this variant also does not need
any modifications to kdm. of course there is still no auto-rescan of
Xservers, but who cares. *g*   untested ...

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.


#! /bin/bash

pidfile=/var/run/xdm.pid
kdmrc2=/var/run/sunray-kdmrc

rescan()
{
  {
    dpys=
    while read dpy keyword cmd; do # this might be unsufficient
      test "$keyword" = local || continue  # this is an assertion, actually
      dpys="$dpys,$dpy"
      echo -e "[X-$dpy-Core]\nServerCmd=$cmd\n"
    done < .../Xservers
    echo -e "[General]\nStaticServers=${dpys:1}\n"
  } > $kdmrc2
  kill -HUP $pid
}

killoff()
{
  kill $pid
}

echo $$ > $pidfile
kdm -nodaemon +config $kdmrc2 "$@" & pid=$!
trap rescan HUP
trap killoff TERM
wait $pid
rm $pidfile


#! /bin/bash

kdmrc=${1:-/what/ever/path/share/config/kdm/kdmrc}
tmprc=$(tempfile -s .kdmrc)

{
  dpys=
  while read dpy keyword cmd; do # this might be unsufficient
    test "$keyword" = local || continue  # this is an assertion, actually
    dpys="$dpys,$dpy"
    echo -e "[X-$dpy-Core]\nServerCmd=$cmd\n"
  done < .../Xservers
  sed "s,^StaticServers=.*\$,StaticServers=${dpys:1}," < $kdmrc
} > $tmprc
kdm_config.real $tmprc
ex=$?
rm $tmprc
exit $ex


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic