Messages in cipher reflected in the looking glass
[ Yasuhiro Fujitsuki's Weblog ]
http://blogs.sun.com/thaniwa/date/20070508 2007年 5月 08日 火曜日

(EN) Diskless Solaris x86 Part 2 : Use JDS(Gnome) on diskless client

Previous content is : (EN) Diskless Solaris x86 Part 1 : Setup Diskless Solaris Environment .

When using diskless client, some troubles might occur, which does not occur in the normal environments.
There are some tips to use diskless client.

Fails in login of Java Desktop System(Gnome).

If you do not customize after setup the diskless client, user can log into CDE desktop environment, but user cannot login with JDS environemnt and cannot use gnome-based application as gnome-terminal and so on.
Core file was found in the home directory after failed to log in. So, I checked the core file with pstack. The followings are output of the pstack.

core file ( Locale=C )

# pstack core
core 'core' of 10077:   /usr/lib/gnome_segv gnome-session 11 2.6.1
 fce54179 FcPatternPosition (81fd128, fce6398c) + 69
 fce54244 FcPatternFindElt (81fd128, fce6398c) + 34
 fce54f64 FcPatternGet (81fd128, fce6398c, 0, 8045670) + 34
 fce553dc FcPatternGetCharSet (81fd128, fce6398c, 0, 80456bc) + 3c
 fce5063b FcSortWalk (81b1d30, 422, 8297ef8, 8045724, 1) + 73
 fce50be4 FcFontSetSort (8103a30, 8045780, 1, 81029e0, 1, 0) + 3fc
 fce50d52 FcFontSort (8103a30, 81029e0, 1, 0, 80457cc, 81029e0) + ca
 fe838043 pango_fc_font_map_get_patterns () + 157

core file ( Locale=ja)

# pstack core.ja
core 'core.ja' of 8063: jp.co.justsystem.atokx2.BasicAux
 fd8507e7 kill     (b, 0, 8045250) + 7
 fd85001f __sighndlr (b, 0, 8045250, 80a13c0) + f
 fd8465d9 call_user_handler (b, 0, 8045250) + 22b
 fd846759 sigacthandler (b, 0, 8045250) + bb
 --- called from signal handler with signal 11 (SIGSEGV) ---
 fd434179 FcPatternPosition (841bcb0, fd44398c) + 69
 fd434244 FcPatternFindElt (841bcb0, fd44398c) + 34
 fd434f64 FcPatternGet (841bcb0, fd44398c, 0, 80454fc) + 34
 fd4353dc FcPatternGetCharSet (841bcb0, fd44398c, 0, 8045548) + 3c
 fd43063b FcSortWalk (82d97b0, 426, 83bbb88, 80455b0, 1) + 73
 fd430be4 FcFontSetSort (823b298, 804560c, 1, 8233988, 1, 0) + 3fc
 fd430d52 FcFontSort (823b298, 8233988, 1, 0, 8045658, 8233988) + ca
 fd358043 pango_fc_font_map_get_patterns () + 157

As for this cause, the following URL becomes reference.
http://www.opensolaris.org/jive/thread.jspa?threadID=22240&tstart=195
This error occured because fc-cache failed in making the font cache file.
Fc-cache process start up in boot time of solaris, in this time fc-cache make font cache file if fc-cache cannot find font cache file in font directory under /usr.
But, fc-cache cannot make font cache file in the diskless client environment, because diskless client mounts /usr in read-only mode.
Fc-cache start up when font cache files found in the font directory, so to prepare font cache files is the way to fix this bug.

To fix, change mode of the /usr directory to read and write mode, and make font cache files. (It seems okay to copy font cache files from server)


You can check the state of sharing of the /usr directory by share command.

# share
-               /export/exec/Solaris_10_i386.all/usr   ro   ""
-               /export/root/w1100z   rw=w1100z,root=w1100z   ""
-               /export/swap/w1100z   rw=w1100z,root=w1100z   ""

change share setting of /export/exec/Solaris_10_i386.all/usr /etc/dfs/dfstab as follows.

# share -F nfs -o ro /export/exec/Solaris_10_i386.all/usr
share -F nfs -o rw=w1100z,root=w1100z /export/exec/Solaris_10_i386.all/usr
share -F nfs -o rw=w1100z,root=w1100z /export/root/w1100z
share -F nfs -o rw=w1100z,root=w1100z /export/swap/w1100z

execute shareall command to update state of directory share.

# shareall
# share
-               /export/exec/Solaris_10_i386.all/usr   rw=w1100z,root=w1100z   ""
-               /export/root/w1100z   rw=w1100z,root=w1100z   ""
-               /export/swap/w1100z   rw=w1100z,root=w1100z   ""

Next step is change mount setting of the /usr directory of "vfstab" for the diskless client.( /export/root/w1100z/etc/vfstab )

#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
/devices        -               /devices        devfs   -       no      -
/proc           -               /proc           proc    -       no      -
ctfs            -       /system/contract        ctfs    -       no      -
objfs           -       /system/object  objfs   -       no      -
fd              -               /dev/fd         fd      -       no      -
swap            -               /tmp            tmpfs   -       yes     -

x4200m2:/export/root/w1100z     -       /       nfs     -       -       rw
x4200m2:/export/swap/w1100z     -       /dev/swap       nfs     -       -       -
/dev/swap       -       -       swap    -       -       -
# x4200m2:/export/exec/Solaris_10_i386.all/usr   -       /usr    nfs     -       -       ro
x4200m2:/export/exec/Solaris_10_i386.all/usr    -       /usr    nfs     -       -       rw

Boot the diskless client and log into JDS environment.
After that font cache files, fonts.cache-1 and so on, appeared in the font directory like a following.

# cd /export/exec/Solaris_10_i386.all/usr/openwin/lib/X11/fonts/Type1
# ls -l
-rw-r--r--   1 root     bin         4204 Dec 16  2004 fonts.alias.all
-rw-r--r--   1 root     root        8013 Apr 23 14:10 fonts.cache-1
-rw-r--r--   1 root     bin         1162 Dec 16  2004 fonts.dir
-rw-r--r--   1 root     bin         1162 Dec 16  2004 fonts.scale
drwxr-xr-x   2 root     bin          512 Apr 23 14:10 outline
drwxr-xr-x   2 root     bin          512 Apr 23 14:10 prebuilt
drwxr-xr-x   3 root     bin         2048 Apr 23 14:10 sun

You only have to do this method only once on one diskless client per server even if you set up some diskless clients. So, after do this method, you may return it to default setting.

/opt of the diskless client is empty...

/opt directory of the diskless client is empty, because mouting /opt information is not in /etc/vfstab file of the diskless client.

In generally, some applications, StarSuite(StarOffice), Netbeans and so on, in the /opt directoy. So it is useful to share and mount /opt directory.
/opt directory for diskless client is in /export/Solaris_10 directory. To mount /opt directory, change /etc/dfs/dfstab to share /export/Solaris_10/opt directory on the server.

share -F nfs -o rw=w1100z,root=w1100z /export/Solaris_10/opt

Do not forget to execute shareall command on server console.
Next step is to change vfstab of the diskless client. ( /export/root/w1100z/etc/vfstab )

#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
/devices        -               /devices        devfs   -       no      -
/proc           -               /proc           proc    -       no      -
ctfs            -       /system/contract        ctfs    -       no      -
objfs           -       /system/object  objfs   -       no      -
fd              -               /dev/fd         fd      -       no      -
swap            -               /tmp            tmpfs   -       yes     -

x4200m2:/export/root/w1100z     -       /       nfs     -       -       rw
x4200m2:/export/swap/w1100z     -       /dev/swap       nfs     -       -       -
/dev/swap       -       -       swap    -       -       -
# x4200m2:/export/exec/Solaris_10_i386.all/usr   -       /usr    nfs     -       -       ro
x4200m2:/export/exec/Solaris_10_i386.all/usr    -       /usr    nfs     -       -       rw
x4200m2:/export/Solaris_10/opt    -       /opt    nfs     -       yes       ro

I will write about patch in the next time.