Log in

No account? Create an account

Gonzo's Recorded History

Ancient history

December 9th, 2007

SUMMARY: Unable to install SUNWmdr and SUNWmdu on jumpstart @ 11:52 pm

So, I've been battling Jumpstart. It's Solaris' method of installing a mass group of clients. I found out the low level problem, and I'm sure there's a high level solution, but here is my low level solution. I'll update it if someone can give me a better solution rather than hacking the packages themselves. Sorry if I go into technical detail here, Google do your magic and help some other poor soul.

Solaris Volume Manager (SVM) aka Solstice Disk Suite wasn't getting installed right. It was relatively easy to fix, sure, but goddamn is it annoying to have your machine's default boot state to be 'Enter your root password:' to fsck the disk instead of coming up right. So you had to connect a console to fix it, every jumpstart. So I wanted it fixed, permanently. I had problems with other things in it, like it going interactive, which is annoying and ended up removing /sbin/suninstall to fix (DON'T ASK!). Also, I thought it was the noaccess user screwing me over (pkgadd runs as that), but that was a red herring that took me 4 some hours to figure out. Then I found out the real problem.

Anyway, it turns out that for some reason, in my version of Jumpstart and JET (my jumpstart assist tool), with Solaris 9 9/05, << wasn't working right. Normally, that's the pipe character to say 'until you see the next word, add all this text to whatever program.' So, you'd see:
cat >$1 <<THEEND
Which can easily be done instead as: (This is what I actually pasted in instead of the << crap)
echo "CLASSES=\"${CLASSES}\"">$1
echo "IS_AN_UPGRADE=\"${IS_AN_UPGRADE}\"">>$1
echo "RELEASE=\"${RELEASE}\"">>$1
echo "COPY_CONFIG=\"${COPY_CONFIG}\"">>$1

When you try to install SUNWmdr and SUNWmdu, the SVM packages, it would bomb out with messages like:
/tmp/installuRa4Dw/checkinstallwRa4Dw: /tmp/sh115060: cannot create
pkgadd: ERROR: checkinstall script did not complete successfully

This was because the << above was causing the 'cannot create' when it ran. After 3 fucking days of fighting jumpstart, I finally find the real problems. This is new to 9 9/05 as well, cause it worked fine in our old 9/04 (I think that was our version). All cause I got a new server that is a different architecture.

Anyway, Solutions! That's what I'm all about. Here was the final plan:
[ gonzo@machine ] $ cd  /jumpstart/OS/Sol9/Solaris_9/Product/SUNWmdr
[ gonzo@machine ] $ sudo vi  install/checkinstall
# Find the << lines and change it to the above format, with echo's instead.  The one above is the SUNWmdr one.
[ gonzo@machine ] $ wc -c install/checkinstall ; sum install/checkinstall
# Use the character count (first line) and the sum line (second line, first number)   This is my SUNWmdr one, post-hacking.
    2680 install/checkinstall
16216 6 install/checkinstall
[ gonzo@machine ] $ sudo vi pkgmap
# replace the numbers in pkgmap for checkinstall so the package is still valid.
[ gonzo@machine ] $ cd  /jumpstart/OS/Sol9/Solaris_9/Product/SUNWmdu
# Same thing all over again, with the single line of 'CLASS' instead. goddamnit.

I didn't sleep last night. It's 11:52 pm. 20-30 some jumpstarts later. I'm going to fucking bed as soon as jumpstart finishes, which takes about an hour and a half every cycle, so you can imagine how painful this was to fix. So fuck jumpstart, right the ear. And in fact, the package went in successfully, so I'm going to goddamn bed. heh Update1: It worked, the machine is up, and now I just need to get a storage device that I've never used before to work. By tonig.. oh wait. doh. `8r/
Share  |  |


[User Picture Icon]
Date:December 10th, 2007 03:03 pm (UTC)
You know, your problem with Jumpstart is one of the reasons I refused to use Unix in any of its incarnations for my entire working life. Anything that sits there and dares you do do something right, should be exorcised, burned at the stake, and all of its male children gelded.
[User Picture Icon]
Date:December 10th, 2007 03:27 pm (UTC)
Oh it's great when it's working right. It's just difficult to deal with, and I'm adept at dealing with it's idiosyncrasies.

UNIX is user friendly. But it's just very particular about who it's friends are.
[User Picture Icon]
Date:December 10th, 2007 03:11 pm (UTC)
(Found you from /.)

I suggest pointing truss at the shell running the script with '<<' in it, and watch for where it tries to create a file in /tmp with open() or creat(). See what return code you get. I would be on /tmp/ being on a full filesystem if I got that error, but I'd guess you've checked that. :-)
[User Picture Icon]
Date:December 10th, 2007 03:25 pm (UTC)
Yeah, um it's somewhat hard because it's forked off of the shell, and if I trace forks, and I'm on a shell that I'm running the truss, I get a trace off of the truss I'm running... yeah bad.

And I can do an echo bob >/tmp/bob fine, but a cat >bob <<ENDOFBOB fails on the first line, nevermind when I get to the ENDOFBOB. heh
[User Picture Icon]
Date:December 10th, 2007 04:22 pm (UTC)
Hrm. So I can do (this is on Linux but I assume will work with truss also, substitute for -f whatever your follow-fork-flag is)

strace -f sh -c 'cat >bob <<ENDOFBOB'

And I can see it making the open(...) call on a file in /tmp/.

Edited at 2007-12-10 04:24 pm (UTC)
Date:December 10th, 2007 08:34 pm (UTC)
Wow I spent a few weeks writing software this year that would make your life easier but I can't write about it so much. I'm mysteriously near-useful like that :P

Gonzo's Recorded History

Ancient history