Alan Hargreaves' Blog

The ramblings of an Australian SaND TSC* Principal Field Technologist

Archive for the ‘OpenSolaris’ Category

Nevada to OpenSolaris Sun Ray on SPARC (part 7 – printing)

OK, I find myself needing to print something so let’s get CUPS configured.

Oh, it’s not in the default install, …

$ pfexec pkg install print/cups
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  2/2     856/856      3.9/3.9

PHASE                                        ACTIONS
Install Phase                              1037/1037
PHASE                                          ITEMS
Reading Existing Index                           8/8
Indexing Packages                                2/2

Now before we can do anything we need to enable the services.

$ pfexec svcadm enable cups/scheduler
$ pfexec svcadm enable cups/in-lpd
$ pfexec print-service -s cups

The last one above is vitally important, or you will find that the web interface gives you “500 Internal Error”, which is not helpful and /var/log/cups
/error_log
contains a line like:

E [07/Aug/2010:12:08:52 -1000] [CGI] Unable to connect to cupsd: No such file or directory

Which is equally unhelpful.

Update: Looks like you only need to run the pfexec print-service -s cups, as it does the appropriate svcadm commands. Thanks Ghee Teo for that.

Now the rest is in the web, specifically http://localhost:631 and following the pretty intuitive interface.

To get a relatively generic ppd file I went to the postscript printers at openprinting.org and downloaded the ppd for the Apple 12/640ps. This will do as my generic until I can find someone with a mac who has installed the mac “drivers” for the Xerox Docucentre-II 2055 and the ApeosPort-II C4300.

Don’t forget to go set the printing defaults, like duplexing and paper size.

Interestingly, while under my previous install (nv128) the printers showed up in my print menus, they are not doing so here. That’s a problem for another day as at least I can print using lp(1).

Update #1

Actually the ppd file I selected above gave me problems with the Docucentre printer, so I removed it (for some reason I couldn’t select a different make of printer from the web interface, well I could select it but it wouldn’t have any effect), and reinstalled it as the Generic Postscript. Now that one has the issue that it will only do single sided, so I went in and edited the ppd file in /etc/cups/ppd and changed

*UIConstraints: *Duplex *Option1 False
*UIConstraints: *Option1 False *Duplex

to

*UIConstraints: *Duplex *Option1 True
*UIConstraints: *Option1 True *Duplex

which seems to make it happy now when I try to set the default to double sided/Long edge, and it even actually now prints double sided.

Update #2

For the ApeosPort-II I set up the configuration and modified it as above as well as changing

*DefaultColorSpace: Gray

to

*DefaultColorSpace: RGB

which also seems to do the right thing for this printer.

Now the only niggle I have to deal with is that some of the fonts print absolutely awfully, although it’s still more than readable.

Update #4

The fonts was easy. I had just chosen a crappy looking font. Choosing another improved things immensely.

Getting the full printing functionality took installation of a few more packages that were not installed automatically.

library/desktop/gtk2/gtk-backend-cups Used by the GNOME Apps print dialog
print/cups/system-config-printer Print manager for CUPS
print/cups/hal-cups-utils local USB printer auto-detection daemon

Now my applications are coming up with the queues I defined.

Advertisements

Written by Alan

August 8, 2010 at 11:40 am

Posted in OpenSolaris, Work

Nevada to OpenSolaris Sun Ray on SPARC (part 6 – cutting over)

I had opportunity today to point my Sun Ray DTU at the box that I have been building up. Actually using it is really the only way to see what I had forgotten.

I wanted to go to the newer gnome looking desktop so ran

$ gnome-cleanup
...

Which also meant I had to reset some of my preferences, but that was not really a problem. Little things like the number of workspaces (12 from 4), making my terminal sessions white on black, changing to a simpler theme and as I am doing Sun Ray from home, going to a solid colour background. Oh, I had to make gnome-terminal do each session as a login session to get my path fully right too.

Open Office

$ pfexec pkg install office/openoffice
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                10/10   4238/4238  173.6/173.6

PHASE                                        ACTIONS
Install Phase                              4848/4848
PHASE                                          ITEMS
Reading Existing Index                           8/8
Indexing Packages                              10/10

I actually noticed the absence of this not from having to use office, but because I configured pidgin to use some of its wav files for notify sounds and it was unusually quiet.

flash

I need the extras repository, OK, I can grab the certificates off my notebook rather than go to the site again.

$ pfexec mkdir /var/pkg/ssl
$ cd /var/pkg/ssl
$ pfexec scp alan@blues:///var/pkg/ssl/\*.pem .
Password:
OpenSolaris_extras.c 100% |*****************************|   775       00:00
OpenSolaris_extras.k 100% |*****************************|   888       00:00
$ pfexec pkg set-publisher -k OpenSolaris_extras.key.pem -c \
    OpenSolaris_extras.certificate.pem -O https://pkg.sun.com/opensolaris/extra/ \
    extra

I also needed to import the certificate into firefox as I’d forgotten the actual name of the flash package.

$ openssl pkcs12 -in /var/pkg/ssl/OpenSolaris_extras.certificate.pem \
	-inkey /var/pkg/ssl/OpenSolaris_extras.key.pem -export > \
	/tmp/OpenSolaris_extras.certificate.pkcs12
Enter Export Password:
Verifying - Enter Export Password:

Full instructions for importing certificates to firefox can be found here.

OK, now we can add flash.

$ pfexec pkg install web/firefox/plugin/flash
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  5/5         3/3      4.5/4.5

PHASE                                        ACTIONS
Install Phase                                  58/58
PHASE                                          ITEMS
Reading Existing Index                           8/8
Indexing Packages                                5/5

acroread

Downloaded the package from adobe.com then:

$ cd /tmp
$ gzcat AdobeReader_enu-8.1.7-1.sparc.tar.gz|tar vxf -
AdobeReader/
AdobeReader/INSTALL
AdobeReader/ReadMe.htm
AdobeReader/COMMON.TAR
AdobeReader/SSOLR.TAR
$ cd AdobeReader
$ pfexec ./INSTALL
This installation requires 155 MB of free disk space.

Enter installation directory for Adobe Reader 8.1.7 [/opt]  <enter>
/opt

Installing platform independent files ... Done

Installing platform dependent files ... Done
Please login again for changes to MIME types and icons to take effect.

That leaves me to only configure cups and resync my zpool with the old workstation. It’s feeling a little zippier even though it has one gig less memory, so it’s looking good.

Written by Alan

August 2, 2010 at 6:21 pm

Posted in OpenSolaris, Work

Nevada to OpenSolaris Sun Ray on SPARC (part 5 – Sun Ray Server 4.2)

I finally managed to get the SRSS 4.2 server software running on my setup. Note that SRSS 4.2 is the server version that is included with the Sun Ray 5.0 download.

First up I needed to install the software. It comes packaged as a zip file (srss_4.2_solaris.zip), extracting into srss_4.2.

It looks like if you want the web configuration interface you need to install tomcat from this distribution too. You can find this in srss_4.2/Supplemental/Apache_Tomcat/apache-tomcat-5.5.20.tar.gz. I installed it like this.

$ gzcat apache-tomcat-5.5.20.tar.gz | (cd /opt ; pfexec tar xf -)
$ cd /opt
$ ln -s apache-tomcat-5.5.20 apache-tomcat

You can then do the srss install, answering the questions asked (not included here as I forgot to record it). The symlink above means that you can sensibly accept the default location for Tomcat.

$ cd srss_4.2
$ pfexec ./utinstall

This is unfortunately not enough to get us going. When I went to run /opt/SUNWut/sbin/utadm -L it immediately complained about not being able to find the DHCP server stuff. I have no interest whatsoever in installing the DHCP stuff. After some poking around I found that all I really needed to do was to edit /etc/opt/SUNWut/auth.props and make the setting

allowLANConnections = true

But that’s not all, …

I was still getting the 26B on the Sun Ray DTU on attempting to utswitch to the new machine.

This error code apparently means “Waiting for X”. Fortunately there was a wonderful wiki entry on getting SRSS 4.1 working with OpenSolaris 2009.06. I’ll re-document it as there were some things that I did not need to do (as they had been addressed in SRSS 4.2) and others which I thought less than clear.

You need the motif libraries. Sorry, no way around it, it’s linked against them. Fortunately they are available in the opensolaris.org repository.

$ pfexec pkg install SUNWmfrun SUNWtltk SUNWdtbas

I saw the following error in /var/log/gdb/:11.log (11 being the session number it allocated me).

ld.so.1: Xnewt: fatal: libXfont.so.1: open failed: No such file or directory

Ahhh this was because some libraries moved. To fix it you need to do the following

# cd /usr/lib
# ln -s xorg/libXfont.so .
# ln -s xorg/libXfont.so.1 .
# ln -s xorg/libfontenc.so .
# ln -s xorg/libfontenc.so.1 .
# cd sparcv9
# ln -s ../xorg/sparcv9/libXfont.so .
# ln -s ../xorg/sparcv9/libXfont.so.1 .
# ln -s ../xorg/sparcv9/libfontenc.so .
# ln -s ../xorg/sparcv9/libfontenc.so.1 .

I also created /etc/opt/SUNWut/X11/fontpath with the following contents

/usr/share/fonts/X11/100dpi
/usr/share/fonts/X11/100dpi-ISO8859-1
/usr/share/fonts/X11/100dpi-ISO8859-15
/usr/share/fonts/X11/75dpi
/usr/share/fonts/X11/75dpi-ISO8859-1
/usr/share/fonts/X11/75dpi-ISO8859-15
/usr/share/fonts/X11/encodings
/usr/share/fonts/X11/isas
/usr/share/fonts/X11/misc
/usr/share/fonts/X11/misc-ISO8859-1
/usr/share/fonts/X11/misc-ISO8859-15
/usr/share/fonts/X11/Type1

Finally I had to edit /opt/SUNWut/lib/xmgr/gdm/remove-dpy since gdmdynamic arguments appear to have changed. Replacing

gdmglue="; gdmdynamic -b -d "'$UT_DPY'

with

gdmglue="; gdmdynamic -d "'$UT_DPY'

Just to make sure everything had “taken”, I rebooted the box.

It looks like this did the trick. I am able to /opt/SUNWut/bin/utswitch -h sb2000-b and login correctly and actually get a usable desktop.

As I’ve done a bit of work on vesvi since I synced the filesystems onto sb2000-b I’ll need to sync those over again before I start trying to use this as my desktop for a bit before physically moving the disk over to vesvi (and all of the associated network reconfiguration and probably creating another certificate for imapd).

I can see the light at the end of the tunnel and it is not an oncoming train.

It should go without saying (but I’ll say it anyway). Getting Sun Ray running like this OpenSolaris completely voids any warranty and support. Don’t do it if you don’t know what you are doing.

Written by Alan

July 26, 2010 at 7:47 pm

Posted in OpenSolaris, Work

Nevada to OpenSolaris Sun Ray on SPARC (part 4 – imapd)

Had another go at building UOW imapd. This time I’m going to try with the studio12 compiler after a brief exchange with George Shepherd who has managed to get this to build.

$ pfexec pkg install developer/sunstudio12u1
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                33/33 11633/11633  548.7/548.7

PHASE                                        ACTIONS
Install Phase                            18370/18370 
PHASE                                          ITEMS
Reading Existing Index                           8/8 
Indexing Packages                              33/33
Indexing Packages                              33/33
Optimizing Index...
PHASE                                          ITEMS
Indexing Packages                            750/750 

Changed src/osdep/unix/Makefile so that

CC=/usr/bin/cc
SSLCERTS=/etc/openssl/certs
SSLKEYS=$(SSLCERTS)
SSLINCLUDE=/usr/include/openssl
SSLLIB=/usr/lib

It looks like you need to install this by hand. Note that I’m only installing imapd. I am really not interested in pop.

$ pfexec cp imapd/imapd /usr/sbin

Then if we are going to use SSL then we need a certificate. For my purposes I create a self signed one that will last 10 years. I’m going to have to do this again when I rename the machine.

# cd /etc/openssl/certs
# openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 3650
Generating a 1024 bit RSA private key
.....................................++++++
................................................++++++
writing new private key to 'imapd.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) []:AU
State or Province Name (full name) []:NSW
Locality Name (eg, city) []:Gordon
Organization Name (eg, company) []:Oracle
Organizational Unit Name (eg, section) []:TSC
Common Name (eg, YOUR name) []:sb2000-b.aus.sun.com
Email Address []:

It appears to be crucial to get the fully qualified hostname as the common name.

Now we can add the imap services to /etc/inetd.conf

imap    stream  tcp     nowait  root    /usr/sbin/imapd     imapd
imaps   stream  tcp     nowait  root    /usr/sbin/imapd     imapd

and then add it into SMF

$ pfexec inetconv
imap -> /lib/svc/manifest/network/imap-tcp.xml
Importing imap-tcp.xml ...Done
imaps -> /lib/svc/manifest/network/imaps-tcp.xml
Importing imaps-tcp.xml ...Done

Configure it up into thunderbird and wonder of wonders, it looks like it works.

Update #1

I forgot to mention the make command that I used to build it was:

$ make soc

Next trick will be Sun Ray Server.

Written by Alan

May 25, 2010 at 10:04 pm

Posted in OpenSolaris, Work

Nevada to OpenSolaris Sun Ray on SPARC (part 3 – reboot)

OK, I just got the machine allocated back to me. This time I set the booking to a year rather than two weeks. I can drop the booking when I’m done.

Set jumpstart to snv_120 with only the SUNWcreq cluster to get wanboot and did root zpool install (as it appears to run much faster and this is only the interim installation).

Once that was done, I needed to reset the jumpstart information to grab 2009.06 from our jumpstart server and then do a

ok boot -F wanboot -o dhcp

Boot device: /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@w2100000c50566f74,0:a  File and args: -F wanboot -o dhcp
<time unavailable> wanboot info: WAN boot messages->console
<time unavailable> wanboot info: configuring /pci@8,700000/network@5,1:

<time unavailable> wanboot info: Starting DHCP configuration
<time unavailable> wanboot info: DHCP configuration succeeded

<time unavailable> wanboot info: Default net-config-strategy: dhcp
<time unavailable> wanboot progress: wanbootfs: Read 368 of 368 kB (100%)
<time unavailable> wanboot info: wanbootfs: Download complete
Thu Apr 29 07:41:33 wanboot progress: miniroot: Read 175868 of 175868 kB (100%)
Thu Apr 29 07:41:33 wanboot info: miniroot: Download complete
SunOS Release 5.11 Version snv_111b 64-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
strplumb: open /devices/pseudo/clone@0:ssd failed: 19
WARNING: consconfig: cannot find driver for screen device /pci@8,700000/SUNW,m64B@1
Hostname: opensolaris
Remounting root read/write
Probing for device nodes ...
Preparing automated install image for use
The AI image will be retrieved from /export/install/sparc/os/osol-0906-111b2-ai/ directory
Downloading solaris.zlib archive
--00:44:56--  http://10.15.2.227:5555/export/install/sparc/os/osol-0906-111b2-ai//solaris.zlib
           => `/tmp/solaris.zlib'
Connecting to 10.15.2.227:5555... failed: Network is unreachable.
FAILED
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run

Enter user name for system maintenance (control-d to bypass): root
Enter root password for system maintenance (control-d to bypass): 
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode

Apr 29 00:45:44 su: 'su root' succeeded for root on /dev/console
-bash: /usr/sbin/quota: No such file or directory
Sun Microsystems Inc.	SunOS 5.11	snv_111b	November 2008
root@:~# ifconfig -a plumb
root@:~# ifconfig eri0 dhcp
root@:~# cat > /etc/resolv.conf
nameserver <address>
root@:~# rm /etc/nsswitch.conf
root@:~# cat /etc/nsswitch.dns > /etc/nsswitch.conf
root@:~# umount /etc/netboot
root@:~# rm -rf /etc/netboot
root@:~# umount /tmp
root@:~# svcadm disable dscp
root@:~# svcadm disable sckmd
root@:~# Remounting root read/write
Probing for device nodes ...
Preparing automated install image for use

The AI image will be retrieved from /export/install/sparc/os/osol-0906-111b2-ai/ directory
Downloading solaris.zlib archive
--00:54:19--  http://10.15.2.227:5555/export/install/sparc/os/osol-0906-111b2-ai//solaris.zlib
           => `/tmp/solaris.zlib'
Connecting to 10.15.2.227:5555... connected.
HTTP request sent, awaiting response... 200 OK
Length: 83,334,656 (79M) [text/plain]

100%[====================================>] 83,334,656    11.28M/s    ETA 00:00

00:54:26 (11.25 MB/s) - `/tmp/solaris.zlib' saved [83334656/83334656]

Downloading solarismisc.zlib archive
--00:54:26--  http://10.15.2.227:5555/export/install/sparc/os/osol-0906-111b2-ai//solarismisc.zlib
           => `/tmp/solarismisc.zlib'
Connecting to 10.15.2.227:5555... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,857,408 (3.7M) [text/plain]

100%[====================================>] 3,857,408     10.71M/s             

00:54:26 (10.70 MB/s) - `/tmp/solarismisc.zlib' saved [3857408/3857408]

--00:54:26--  http://10.15.2.227:5555/export/install/sparc/os/osol-0906-111b2-ai//install.conf
           => `/tmp/install.conf'
Connecting to 10.15.2.227:5555... connected.
HTTP request sent, awaiting response... 200 OK
Length: 83 [text/plain]

100%[====================================>] 83            --.--K/s             

00:54:26 (3.09 MB/s) - `/tmp/install.conf' saved [83/83]

Done mounting automated install image
Configuring devices.
Reading ZFS config: done.

root@:~# logout
Service discovery phase initiated
Service name to look up: OpenSolaris-2009-06-AI-sparc

opensolaris console login: Service discovery over multicast DNS failed
Service located at 10.15.2.227:5555 will be used
Service discovery finished successfully
Process of obtaining configuration manifest initiated
Configuration manifest obtained
Automated Installation started
The progress of the Automated Installation can be followed by viewing  the logfile at /tmp/install_log

Oops, I forgot to clear the dns/multicast service and of course the install failed

root@opensolaris:~# svcadm clear dns/multicast
root@opensolaris:~# svcadm clear auto-installer
root@opensolaris:~# Service discovery phase initiated
Service name to look up: OpenSolaris-2009-06-AI-sparc
Service discovery finished successfully
Process of obtaining configuration manifest initiated
Configuration manifest obtained
Automated Installation started
The progress of the Automated Installation can be followed by viewing  the logfile at /tmp/install_log

This time we got a little further but ended up with:

<OM Apr 29 08:03:10> Transfer process initiated
<OM Apr 29 08:03:10> IPS transfer mechanism selected
<OM Apr 29 08:03:10> IPS transfer phase initiated
<TRANSFER_MOD_E Apr 29 08:03:13> Unable to initialize the pkg image area at /a
<TRANSFER_MOD Apr 29 08:03:13> TValueError or TABort
<OM Apr 29 08:03:13> IPS initialization phase 1 failed
<OM Apr 29 08:03:13> Transfer failed with error -1
Automated Installation failed
Please refer to /tmp/install_log file for  details
Apr 29 01:03:20 opensolaris svc.startd[7]: application/auto-installer:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
<AI Apr 29 08:03:20> om_perform_install failed with error 114
<AI Apr 29 08:03:20> Auto install failed

Looking at /tmp/install_log I see where I tripped up. It was trying to grab files from an internal server without a fully qualified domain name.

root@opensolaris:~# cat >> /etc/resolv.conf
search Aus.Sun.COM Sun.COM
root@opensolaris:~# svcadm clear auto-installer
root@opensolaris:~# Service discovery phase initiated
Service name to look up: OpenSolaris-2009-06-AI-sparc
Service discovery finished successfully
Process of obtaining configuration manifest initiated
Configuration manifest obtained
Automated Installation started
The progress of the Automated Installation can be followed by viewing  the logfile at /tmp/install_log

If you are interested in seeing how things are going, you can look at the svc log for the auto-installer.

root@opensolaris:/tmp# tail -f /var/svc/log/application-auto-installer:default.
log
Download: SUNWlang-ka ...  Done
Download: SUNWlang-ar ...  Done
Download: SUNWgetting-started-l10n-sv ...  Done
Download: SUNWlang-sk ...  Done
Download: SUNWgnome-l10nmessages-hu ...  Done
Download: SUNWlang-ms ...  Done
Download: SUNWlang-kk ...  Done
Download: SUNWlang-ro ... 

After some time downloading and installing we got the reboot. As before,

  • installed SUNWyp,
  • put the box under NIS (not forgetting /etc/nsswitch.conf),
  • disabled the jack account (inserted *LK* in the /etc/shadow entry),
  • gave myself the appropriate roles (change the Admin in /etc/user_attr from jack to me),
  • pointed the box at the dev repository,
  • checked to see if I needed a newer version of SUNWipkg (I didn’t),
  • and started the update before going home.

The next day

Peculiar. The upgrade worked but I am getting no response from the serial console.

DOH!

That was something I had to fix last time and hadn’t documented. Powersaving. It hadn’t been doing anything for a few hours so it powered down. Strange that there was nothing on the console. I wonder if it simply suspended and was waiting for a mouse or keyboard event that was never going to happen.

Let’s just disable powerd.

root@sb2000-b:~# svcadm disable system/power

So now we go to start adding extra packages. When going to add database/mysql-51 it looks like the newer versions of pkg don’t like the default publisher to be default and want me to re-add it as opensolaris.org. OK I can do that. We need to add it again with the correct name, change the preferred publisher then remove the old. Then we can begin installing packages, starting with mysql.

root@sb2000-b:~# pkg set-publisher -P -O http://ipkg.sfbay/dev opensolaris.org
root@sb2000-b:~# pkg unset-publisher default
root@sb2000-b:~# pkg install database/mysql-51
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                              641/641     262/262    54.4/54.4

PHASE                                        ACTIONS
Removal Phase                              5750/5750 
Install Phase                                359/359 
PHASE                                          ITEMS
Reading Existing Index                           8/8 
Indexing Packages                            641/641 
Loading smf(5) service descriptions: 1/1

Actually looking at my last blog on this, many of the packages I wanted to install I deferred. So, I should really start getting the disk copied over. It’s probably a good idea to set compression on the rpool so everything will inherit it.

root@sb2000-b:~# zfs set compression=on rpool

For most of the filesystems I want to migrate, they will just live under the rpool, so I can copy them with a script like:

#!/bin/sh

for i in
do	echo $i
	zfs send ${i}@sync | ssh -C ah89892@sb2000-b pfexec /sbin/zfs receive -v -d rpool
done

specifying the filesystems as the argument. I just have a couple of others that I want to be careful where they get placed, so for those I just drop the -d and fully specify the target filesystem.

Well that’s got me back to the point I was when I lost the box. I’ve still got some software to build and install, but the major task for next week will be to get the Sun Ray software running on it so I can switch over and start using it, to see what else I may have overlooked.

Just one other thing that I have to remember is that while my home directory is on a corporate server via nfs, I do have a symlink on this box for my local mail folders that points at pool/export/home/ah89892, so I need to do a final sync up of that before cutting over to running Sun Ray on the Lab box.

Written by Alan

April 30, 2010 at 6:28 pm

Posted in OpenSolaris, Work

ksh93 ENOEXEC errors solved

If you have been following my blogs on transitioning to an OpenSolaris SPARC based Sun Ray server (part 1 and part 2) you would have seen my frustration at the errors I was getting like:

make: sh: cannot execute [Exec format error]
make: sh: cannot execute [Exec format error]
make: sh: cannot execute [Exec format error]
sh: make: function not defined
*** Error code 126

I did some poking around today. I noticed that the stack in the writing of that error message looked like:

              libc.so.1`__write+0x8
              libast.so.1`_sfflsbuf+0x24c
              libast.so.1`sfwrite+0x3e0
              libast.so.1`errorv+0xc34
              libast.so.1`errormsg+0x1c
              libshell.so.1`sh_lex+0x408
              libshell.so.1`term+0x34
              libshell.so.1`list+0x8
              libshell.so.1`sh_cmd+0x18
              libshell.so.1`sh_parse+0x2c0
              libshell.so.1`sh_eval+0x1c8
              libshell.so.1`funload+0x188
              libshell.so.1`path_absolute+0x584
              libshell.so.1`path_search+0x2b4
              libshell.so.1`sh_exec+0xddc
              libshell.so.1`sh_subshell+0x5c8
              libshell.so.1`comsubst+0x998
              libshell.so.1`varsub+0x4f8
              libshell.so.1`copyto+0x8dc
              libshell.so.1`sh_mactrim+0x10c

It’s trying to treat make as if it were a shell function. Huh? of course that’s not going to work.

Inside path_absolute in libshell I found the following:

    767                 isfun = (pp->flags&PATH_FPATH);

Further down this is checked and if it is, the file is opened to be read as a shell script.

ding!

Heading to the man page we see:

     FPATH         The search path for function definitions.  The
                   directories  in  this  path are searched for a
                   file with the same name  as  the  function  or
                   command  when a function with the -u attribute
                   is referenced and when a command is not found.
                   If  an  executable  file with the name of that
                   command is found, then it is read and executed
                   in  the  current environment. Unlike PATH, the
                   current directory must be  represented  expli-
                   citly by dot (.) rather than by adjacent colon
                   (:) characters or a beginning or ending  colon
                   (:).

Now if I add in the fact that I construct my $PATH using $FPATH and $LPATH (among others) a light begins to dawn.

My $FPATH actually contained almost the entirety of my normal path. So, ksh93 (which is also /bin/sh on OpenSolaris) was assuming that anything in any of those directories was a script to be read and parsed, without having to check.

I changed the names of those variables and everything there is now working as it should.

Written by Alan

April 13, 2010 at 9:20 pm

Posted in DTrace, OpenSolaris, Work

Nevada to OpenSolaris on SPARC (part 2)

I am having some trouble with getting the Washington imap server compiled under OpenSolaris on SPARC. That’s ok I can defer that. I only use it for archiving (oh, I need to remember to install MH as well, but again that can wait).

Another side issue I’m seeing is that when I login to the box using my NIS account and work home directory and setup I start seeing some weird errors from ksh whenever I try to run stuff that uses /bin/sh.

make: sh: cannot execute [Exec format error]
make: sh: cannot execute [Exec format error]
make: sh: cannot execute [Exec format error]
sh: make: function not defined
*** Error code 126

I can get around this by doing everything as “jack”, but it’s something else that I need to get to the bottom of. I’ve seen a bug against something that looks similar, but reading through the bug it doesn’t quite seem right. This is something that I can look at a little later I guess.

I’ve currently got about half of the ZFS filesystems across making good use of ZFS snapshots, send and receive, in combination with ssh -C. For example:

rootksh@vesvi:~$ zfs snapshot pool/core@sync                                    
rootksh@vesvi:~$ zfs send pool/core@sync | ssh -C alan@sb2000-b \
        pfexec /sbin/zfs receive -v -d rpool
Password: 
receiving full stream of pool/core@sync into rpool/core@sync
received 1.76GB stream in 925 seconds (1.95MB/sec)    

Iterating over all of the filesystems, and not forgetting to change the mountpoint where I had on my current box. While writing this entry I’ve completed getting the filesystems over. I’ll leave the snapshots on the original so that just before changeover I can verify that there are no further deltas, or if there have I can update the copy.

Looking at Apache, I went to just copy over my apache 1.x config only to find that the new installation only has apache 2.2. Looks like I will have to bite the bullet and finally migrate to apache2.2, well not before time I guess. This too can go onto the “Deferred” list.

Deferred

  • Apache 2.2 Configuration
  • Imap server
  • MH client
  • Work out what is with the exec errors and ksh with my login

Next on the list

  • Sun Ray Server
  • MySQL- It’s installed, I just need to get it configured and running. This is probably one that could be deferred too.

Then I can start using it to see if I have everything. Getting closer.

Written by Alan

April 10, 2010 at 12:37 am

Posted in OpenSolaris, Work