Sometimes being on the bleeding edge you get cut.

While Sun Ray and OpenSolaris build 130 are functional they are not happy. In particular the changes to gdm have resulted in many of the functions of the Sun Ray software not working. Small things like utwho(1) no longer work.

More importantly the login scripts running as the user "gdm" have stopped my scripts that adjust the user shares and stop firefox when users disconnect from working. Since this results in the system being 100% busy all the time an urgent workaround was required.

The workaround uses lots of undocumented features, so I don't expect it to keep working long term but at least it will keep me going until the next upgrade.

The problem of not running as root is trivially solved by using RBAC and then calling utaction via pfexec(1) adding these lines to each of the files:

root@pearson:/root# egrep /etc/security/\*_attr
/etc/security/exec_attr:GDM:solaris:cmd:::/opt/SUNWut/bin/utaction:uid=0
/etc/security/prof_attr:GDM:::Do not assign to users. Profile for GDM so it can run utaction as root:help=Utaction.help
root@pearson:/root# 

Then using usermod to add the GDM profile to the gdm user:

root@pearson:/root# usermod -P GDM gdm

The now the utaction you call from your PostLogin script will be run as root. However instead of passing in the user name, which when the PostLogin script runs you don't know, pass in the name of the Sun Ray session_proc file and read the UID out of there. I have:


function read_session_proc
{
        typeset IFS="="
        typeset key val
        while read key val
        do
                if [[ "$key"="uid" ]]
                then
                        typeset IFS=:
                        typeset u spam
                        getent passwd $val | read u spam
                        print $u
                        break
                fi
        done
}
if [[ "${1#/}" != $1 ]] && [[ -f $1 ]]
then
        USER=$(read_session_proc < $1)
else
        USER=$1
fi

In the adjust shares scripts and this in the PostLogin script (/etc/opt/SUNWut/gdm/SunRayPostLogin/Default):

#!/bin/sh
#
# ident "@(#)PostLoginDefault.sh        1.1 04/05/06 SMI"
#
AD=/usr/local/sbin/adjustshares.workaround
.130

d=${DISPLAY#\*:}
d=${d%.\*}
LOGNAME=/tmp/SUNWut/session_proc/$d
/usr/bin/ctrun -l child -i none /usr/bin/pfexec /opt/SUNWut/bin/utaction -i -c "$AD $LOGNAME 50" -d "$AD $LOGNAME" &


Update: I have added the ctrun otherwise if any of the actions called by utaction dump core then everyone gets logged out. Clearly the core dumps need to be resolved but there is no reason to log everyone out.

Comments:

How do you find the memory usage of the new GDM? I feel like it might have increased dramatically -- on a box with 1GB of RAM six DTUs firing up and displaying the greeter brings the machine to its knees.

Posted by Joshua M. Clulow on January 10, 2010 at 05:18 PM GMT #

6 DTUs and 1GB of RAM! I'm surprised it ever worked. I have 8GB of RAM and "only" 5 DTUs and I've not noticed a memory problem. However the CPU consumption due to lack of Fair Share Scheduler tweeks and not stopping detached firefox sessions has dominated the system until I implemented this fix.

Posted by Chris Gerhard on January 10, 2010 at 11:05 PM GMT #

It was a temporary test VM and most of the DTUs are inactive which is why swap death as soon as they spawned greeters was a bit of a shock. dtlogin (and even the old GDM) seemed to have a much lighter footprint.

Posted by Joshua M. Clulow on January 11, 2010 at 01:08 AM GMT #

How did you get that combo to work (b130 and SRSS 4.2)? I gave up as my DTU was stuck after assigning an IP address. Do you have some install notes to share?

Posted by Wayne Smith on January 11, 2010 at 04:02 AM GMT #

I seem to have failed to blog that bit. Sorry.

I did all of this. Not sure the GL fix is needed for Sun Ray but it was needed for the console session while I debugged this.

ln -s /usr/lib/xorg/libXfont.so.1 /opt/SUNWut/lib
ln -s /usr/lib/xorg/libfontenc.so.1 /opt/SUNWut/lib
rm /usr/lib/xorg/modules/extensions/GL
ln -s ../../../../../var/run/opengl/server \\
/usr/lib/xorg/modules/extensions/GL
mkdir /etc/opt/SUNWut/X11
echo "catalogue:/etc/X11/fontpath.d" > /etc/opt/SUNWut/X11/fontpath
usermod -d /var/lib/gdm gdm

Which got me a functioning Sun Ray but utwho does not work and nor did my utaction scripts. I think I have utwho now working (well I do have it working but before I post how I've sent it to the Sun ray team to be sure I'm not going anything obviously bad).

Posted by Chris Gerhard on January 11, 2010 at 04:34 AM GMT #

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today