Subject: port-i386/25336: buggy config files wdm, wdm-config and Xsession.Xfree86
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <ldecitre@web.de>
List: netbsd-bugs
Date: 04/26/2004 17:52:29
>Number:         25336
>Category:       port-i386
>Synopsis:       buggy config files wdm, wdm-config and Xsession.Xfree86
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 26 17:53:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Emmanuel Decitre
>Release:        1.6.2
>Organization:
>Environment:
NetBSD Skul_3c 1.6.2 NetBSD 1.6.2 (SKUL) #1: Sun Apr 25 09:59:26 GMT 2004     root@Skul_3c:/fserv/NetBSD/1.6.2/src/usr/src/sys/arch/i386/compile/SKUL i386

>Description:
Problem 1
---------

In /usr/pkg/etc/rc.d/wdm from wdm-1.25.tgz binary package, 
required_files refers to 
    /usr/X11R6/etc/wdm/wdm-config instead of /usr/pkg/etc/wdm-config
and command is
    /usr/X11R6/bin/${name} instead of /usr/pkg/bin/${name}


Problem 2
---------

In /usr/pkg/share/examples/wdm/wdm-config, there are many references to 
some config files in /usr/X11R6, although they are in /usr/pkg. But ok, it
is and "example" file...

Problem 3
---------
This problem is a bit more tricky (was for me... ;-) )
In usr/pkg/share/examples/wdm/Xsession.XFree86, the line
   exec "$startup $1" 
shall be changed to
   exec $startup $1
>How-To-Repeat:
Problem 1 & 2
-------------
1) Install wdm-1.25.tgz
2) Copy /usr/pkg/share/examples/wdm/wdm-config in /usr/pkg/etc/
3) If xdm runs, stop it with Ctrl-R, and remove xdm=YES in /etc/rc.conf
3) add wdm=YES in /etc/rc.conf
4) do /etc/rc.d/wdm start

Problem 3
---------
1) Correct Problem 1 & 2 by changing /etc/rc.d/wdm and 
   /usr/pkg/etc/wdm-config like in the section "Fix to the problem"
2) put a "set -xv" in the Xsession.XFree86 script
3) do /etc/rc.d/wdm restart
4) look in /var/log/xdm-errors.log

>Fix:
Problem 1 & 2
-------------
My config files:

/etc/rc.d/wdm:

#!/bin/sh
# PROVIDE: wdm
# REQUIRE: DAEMON LOGIN wscons
# KEYWORD: shutdown
. /etc/rc.subr
name="wdm"
required_files="/usr/pkg/etc/wdm-config"
command="/usr/pkg/bin/${name}"
command_args="-config ${required_files} &"
rcvar=$name
pidfile="/var/run/${name}.pid"
extra_commands="reload"
load_rc_config $name
run_rc_command "$1"

/usr/pkg/etc/wdm-config:

DisplayManager.daemonMode:    true
DisplayManager.errorLogFile:    /var/log/xdm-errors.log
DisplayManager.pidFile:         /var/run/xdm-pid
DisplayManager.keyFile:         /usr/pkg/etc/wdm/xdm-keys
DisplayManager.servers:         /usr/X11R6/lib/X11/xdm/Xservers
DisplayManager.accessFile:      /usr/X11R6/lib/X11/xdm/Xaccess
DisplayManager._0.authorize:    true
DisplayManager._1.authorize:    true
DisplayManager._0.setup:        /usr/X11R6/lib/X11/xdm/Xsetup_0
DisplayManager._0.startup:      /usr/X11R6/lib/X11/xdm/GiveConsole
DisplayManager._0.reset:        /usr/X11R6/lib/X11/xdm/TakeConsole
DisplayManager*session:         /usr/pkg/share/examples/wdm/Xsession.XFree86
DisplayManager*authComplain:    false
DisplayManager*wdmLogin:        /usr/pkg/bin/wdmLogin
DisplayManager*wdmLogo:  /usr/pkg/share/pixmaps/wdm/Earth200x130.xpm
DisplayManager*wdmWm:           icewm:wmaker
DisplayManager*wdmReboot:       /sbin/shutdown -r now
DisplayManager*wdmHalt:         /sbin/shutdown -h now
DisplayManager*wdmVerify:       false
DisplayManager*wdmRoot:         false
DisplayManager*wdmAnimations:   true

Problem 3
---------
1) Change 
      exec "$startup $1" 
   by 
      exec $startup $1
2) use the following .xsession file
     #!/bin/sh
     startkeep() {
       LINE=`wc -l $0 | awk '{print $1;}'`
       head -`expr $LINE - 1` $0 > $0.tmp
       echo $1 >> $0.tmp
       mv $0.tmp $0
       chmod a+rx $0
       exec $1
     }
     case $1 in
        icewm)
        startkeep /usr/X11R6/bin/icewm
        ;;
        wmaker)
        startkeep /usr/pkg/bin/wmaker
        ;;
     esac
     # Check that only one line succeeds to this one
     /usr/X11R6/bin/icewm
>Release-Note:
>Audit-Trail:
>Unformatted: