The connect attribute may only be assigned a service value of "shell" or "nimsh".
??????Andrey Klyachkin
#1 in Automating IBM Power and IBM AIX Infrastructure | POWER DevOps | IT Infrastructure Automation | Speaker | Trainer | Author | IBM Champion | IBM AIX Community Advocate
It was the best error of today. A new IBM AIX server with AIX 7.3 TL1 SP1. But unfortunately without NIM client and with a requirement to install bind.rte. What can be easier? Connect AIX to the NIM server and install the fileset!
# niminit -a name=aix -a pif_name=en0 -a master=nim -a connect=nimsh
0042-358 niminit: The connect attribute may only be assigned
a service value of "shell" or "nimsh".
Oops. I know I am blind. But if I check the command it has "nimsh" there.
OK. Let's diagnose!
I usually use UTF-8-enabled console and may be I typed some symbol which looks like "nimsh" but is not "nimsh", or may be I typed some "unseen" symbol. I re-typed the command and got the same error.
If it was not a typo, then maybe the NIM client fileset is missing on the system.
# lslpp -Lqc | grep nim
bos.sysmgt:bos.sysmgt.nim.client:7.3.1.0: : :C: :Network Install Manager - Client Tools : : : : : : :1:0:/:2245
Looks good. Even the fileset is installed, may be nimsh program is missing on the system.
#?type nimsh
nimsh is /usr/sbin/nimsh
nimsh is also there. It should work! But it does not.
Let's try to use "shell" instead of "nimsh". Even if we don't use rsh in our environment for NIM communications, we can check if niminit command would work.
# niminit -a name=aix -a pif_name=en0 -a master=nim -a connect=shell
The command works. No error messages, niminit creates /etc/niminfo and everything looks OK.
Now I can edit /etc/niminfo and change
export NIM_SHELL="nimsh"
then start nimsh.
# startsrc -s nimsh
0513-059 The nimsh Subsystem has been started. Subsystem PID is 9240888.
It looks good. But it is not my first year administering UNIX. The first rule of every UNIX administrator - check if it really works!
# lssrc -s nimsh
Subsystem???????? Group??????????? PID????????? Status
?nimsh??????????? nimclient???????????????????? inoperative
No, it doesn't work. But at least I will have some logs now.
errlog doesn't show anything useful. Only that the program is crashed:
领英推荐
# errpt | head
IDENTIFIER TIMESTAMP? T C RESOURCE_NAME? DESCRIPTION
1BA7DF4E?? 0222160123 P S SRC??????????? SOFTWARE PROGRAM ERROR
CB4A951F?? 0222160123 I S SRC??????????? SOFTWARE PROGRAM ERROR
CB4A951F?? 0222160123 I S SRC??????????? SOFTWARE PROGRAM ERROR
But if I look into /var/adm/ras/nimsh.log I see a little bit more information:
Wed Feb 22 16:01:27 2023??????? /usr/sbin/nimsh: NIM Service Handler started from SRC
Wed Feb 22 16:01:27 2023??????? no environment value for NIM_SECONDARY_PORT
Wed Feb 22 16:01:27 2023??????? error: getaddrinfo: Hostname and service name not provided or found
The error (getaddrinfo: Hostname and service name not provided or found) brings me first the idea, that DNS is not working or /etc/hosts is not configured on the system.
I checked both - everything is correct and works as it should.
But why does it require some strange variable NIM_SECONDARY_PORT? I checked on other NIM clients and I don't have this variable anywhere. I don't need it - we use standard port numbers for NIM.
What could happen that causes NIM client to check a secondary port configuration? The reason for that can be that NIM client can't find a primary port configuration.
When can't NIM client find a primary port configuration? If it is missing from NIM client configuration (/etc/niminfo) or from server's list of the IP services (/etc/services).
I checked /etc/services and that was the problem! Someone stopped nimsh and deleted nimsh entries from /etc/services. The fix was then easy.
Add the entries into /etc/services:
nimsh??????????????????? 3901/tcp?????????????? # NIM Service Handler
nimsh??????????????????? 3901/udp?????????????? # NIM Service Handler
nimaux????????????????? 3902/tcp??????????????? # NIMsh Auxiliary Port
nimaux????????????????? 3902/udp??????????????? # NIMsh Auxiliary Port
Remove the rests of my debugging:
rm /etc/niminfo
Reinitialize the NIM client:
# niminit -a name=aix -a pif_name=en0 -a master=nim -a connect=nimsh
nimsh:2:wait:/usr/bin/startsrc -g nimclient >/dev/console 2>&1
0513-059 The nimsh Subsystem has been started. Subsystem PID is 8847852.
Check that it started:
# lssrc -s nimsh
Subsystem???????? Group??????????? PID????????? Status
?nimsh??????????? nimclient??????? 8847852????? active
Now it works.
Have fun with AIX!
Andrey