Archive for the ‘unix’ Category

Missing something

Thursday, January 12th, 2012

I must be missing something obvious. AIX has a keyword, mkhomeatlogin, it seems pretty straightforward, and there’s nothing in the docs about having to do anything special to enable it, and yet when I try to turn it on, it fails:

chsec -f /etc/security/login.cfg -s usw -a mkhomeatlogin=true
3004-692 Error changing “mkhomeatlogin” to “true” : Attribute is invalid.

And the PAM alternative isn’t available either,

user:alert syslog: open_module: stat(/usr/lib/security/pam_mkuserhome) failed: No such file or directory

What’s more confusing, there doesn’t seem to be any widespread confusion over these keywords, or indeed Any difficulty that has resulted in the above error message within the context of merely activating the feature, which leads me to suspect I’m missing something obvious. I hate that feeling. But I’d rather feel foolish, and informed, that continue with the frustration.

Upgrading Java on Solaris

Wednesday, September 21st, 2011

You’d think that the people who originally came up with java would have a decent automatic updating mechanism for their own operating system, like happens for Windows. You’d think wrong. Instead, they provide some instructions with vague lines that imply hours of additional work (“make sure all applicable updates have been applied before starting…“), and give zero guidance that I’ve found so far, on make the transition from a JRE to a JDK. If I’m reading my pkginfo results correctly, there are literally dozens of java pkg’s that make up the JRE, and even more for the JDK. Oy vey.

staf: no such file or directory

Tuesday, June 28th, 2011

Another day, another crazy STAF problem. On my RHEL s390 machine:

[x@xxx ~]$ staf local ping ping
-bash: /usr/local/staf/bin/staf: No such file or directory
[x@xxx ~]$ ls -l /usr/local/staf/bin/staf
lrwxrwxrwx 1 root root 24 Jun 29 00:38 /usr/local/staf/bin/staf -> /usr/local/staf/bin/STAF
[x@xxx ~]$ ls -l /usr/local/staf/bin/STAF
-r-xr-xr-x 1 root root 69229 Jun 29 00:38 /usr/local/staf/bin/STAF

UPDATE: It looks like the what had happened is that I had a shell opened at /usr/local/staf, opened a sub-shell, moved /usr/local/staf to /usr/local/staf.old and then did the install. Somewhere/how, the shell was getting confused by the staf it had once known and the staf that was currently there. By backing out to the shell that was in the ‘old’ staf dir and moving him elsewhere, the problem went away.

Still plenty of other issues, but that one is solved.

STAF 345 install errors

Wednesday, June 22nd, 2011

Upgrading 30+ different kinds of UNIX boxes’ STAF installations is a pain in the but under the best of circumstances. It’s made all the more annoying be a recent development where their “InstallAnywhere” installer will randomly fail with:

Stack Trace:
java.util.zip.ZipError: jzentry == 0,

This Application has Unexpectedly Quit: Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)

Out of the 4 times it’s happened so far today, 3 times I was able to get past the error by just trying the install again, after removing any leftover /tmp/install.dir entries. I might have been able to do that with the 1st failure as well, but I tried a different build package first that time.

UPDATE: Oh great, a new error on zlinux,

./STAF345-setup-zlinux-32.bin
Preparing to install…
Extracting the JRE from the installer archive…
Unpacking the JRE…
Extracting the installation resources from the installer archive…
Configuring the installer for this system’s environment…
strings: ‘/lib/libc.so.6′: No such file

Launching installer…

./STAF345-setup-zlinux-32.bin: line 2472: /tmp/install.dir.2598/Linux/resource/jre/jre/bin/java: No such file or directory
./STAF345-setup-zlinux-32.bin: line 2472: exec: /tmp/install.dir.2598/Linux/resource/jre/jre/bin/java: cannot execute: Bad address
# ls -l /tmp/install.dir.2598/Linux/resource/jre/jre/bin/java
-rwxr-xr-x 1 1003 513 58042 Dec 14 2009 /tmp/install.dir.2598/Linux/resource/jre/jre/bin/java

To quote or not to quote

Tuesday, May 24th, 2011

Gotta love trying to come up with a single command that will do the same thing on a dozen different flavors of UNIX, that can handle embedded environmental variables AND potential embedded spaces in filenames, to be executed via a STAF “start process” command, respecting temporary alterations of the effective user/group-id.

If you double quote a string in your command, you can expand dollar-sign-variables, but you lose the tilde-username variable. If you use single-quotes, neither works. If you go without quotes, both variable types work, but you have to figure out how to safely escape spaces in your filenames, without escaping the spaces between tokens in the command itself.

It’s a problem that’s easy to solve in the particular, but seems near impossible to abstract into a universal solution. Maybe I’m just missing something obvious.

That sudo that you do

Monday, May 16th, 2011

I had to explain the interactions between sudo and su to our documentation person at work, which lead to the next question I’m going to ask someone for an interview.

Setup:

in ~root/runme
echo “I ran from root home as $USER”

in ~user1/runme
echo “I ran from user1 home as $USER”

If I enter:

user1@host ~> sudo su – ./runme

what will be printed?

=)

STAF + sudo + HPUX = argh!

Tuesday, May 10th, 2011

Something odd going on in the interaction between STAF and sudo on an HP-UX 11.31 ia64 system. When I sudo from the command line as userx, who as a member of the wheel group, and the sudoers configured to allow no-password commands, I still get prompted for a password, or an error about no tty allocated to ask for a password from (for a while, I somehow managed to attach a random root telnet session such that it was acting as the tty for said messages). After further experimenting, determined that with sudo 1.6.9p11 everything works OK, but with sudo 1.7.4p6, I get uid/eid problems that generate spurious authentication requirements. Investigation continues.

VMWare EasyInstall is full of fail

Wednesday, April 20th, 2011

Usually I do all my VM-ing with LabCenter, an ESX cluster, and a local install of Server. Recently for a group learning event at work, we were tasked with pre-building some VMs using Player. One of the two VMs is based on Ubuntu, so the Create VM wizard helpfully auto-selected it for EasyInstall, which is where things go wrong. EasyInstall prompts me for all the info it’s supposed to use during the install process, which it then throws away into the ether I guess, because the Ubuntu installer asked the same questions. Best part is, giving both prompts the exact same initial username and password, I ended up with an install that didn’t recognize the login credentials I had been supplied.

So, I’m deleteing the ‘easyinstall’-ed VM and starting from scratch. When it auto-detects Ubuntu and wants to EasyInstall, I’m saying no and selecting manually install later. Like 5 seconds later, but whatever. Personally, I wish VMWare would allocate their developer resources to fixing bugs, instead of introducing new bugs for functionality that I wouldn’t have found helpful even if it really worked. It replaced 3 prompts with 3 prompts, there’s no savings in effort or time. What a waste.

CIFS over SMBFS

Monday, January 31st, 2011

After much wailing and gnashing of teeth, I found a suggestion that solved all my Samba vs UTF-8 issues.

It seems that the solution is to just give over and use CIFS instead of SMBFS.

mount -t cifs //server/path /mount/path -odom=DOMAIN,user=USER[,password=PASSWORD]
#I’m optionalizing the password option for safe ps’ing.

Beyond the standards

Monday, December 27th, 2010

If you do any sort of unix shell script-y-ness, you know all about STDIN, STDOUT, and STDERR. If you are a semi-advanced and above user, you know their numeric equivalents (0,1,2) and how they show up, or are implied, in some commands (ls -la 2>errs.go.here). Well it turns out there are defined slots for file descriptors 3-9 3-19, mostly left adrift on the sea of lost inside knowledge. Learning about them, it’s the first I have heard of how any process spawned by exec automatically inherits fd5, so you should avoid using it.

It definitely provides a possible explanation of why an external program being run with stdout and stderr redirected can still print a progress message on-screen.

UPDATE: Advanced Unix Programming by Marc J Rochkind says there are 20 fd’s available.