Tag Archives: AIX

I want alternative of -maxdepth 1 for all Linux,Solaris and AIX

By laxmikant.hclfind /full/path/dir ( ! -name dir -o -type f ) -prune -type f

on AIX it worked perfect :

sdp1:/var/tmp/test# find /var/tmp/test/ ( ! -name test -o -type f ) -prune -name “*properties” -type f -exec ls -l {} ; -exec cksum {} ;

-rw——- 1 root system 19 Dec 12 02:03 /var/tmp/test/1.properties
3921676744 19 /var/tmp/test/1.properties
-rw——- 1 root system 22 Dec 12 02:04 /var/tmp/test/2.properties
2544875996 22 /var/tmp/test/2.properties

but on LINUX it does not
[root@omu-au213 /var/tmp/test]# find /var/tmp/test/ ( ! -name test -o -type f ) -prune -name “*properties” -type f -exec ls -l {} ; -exec cksum {} ;
[root@omu-au213 /var/tmp/test]#

it asks to use -wholename option but that does not work on AIX !!

i tried cd /var/tmp/test/ && find . ( -name . -o -prune ) -name “*properties” -type f -exec ls -l {} ; -exec cksum {} ;

it works on all but it does not gives fuul qualified path name (/var/tmp/test/2.properties) of a file see below :

-rw——- 1 root system 19 Dec 12 02:03 ./1.properties
3921676744 19 ./1.properties
-rw——- 1 root system 22 Dec 12 02:04 ./2.properties
2544875996 22 ./2.properties

i want a generic alternative of -maxdepth 1 for all linux,solaris and AIX. please help!!
Source: The UNIX and Linux Forums

Cannot unzip a file.zip under AIX

Hello everyone,

I have a zip file under AIX. I’m unable to unzip it whith “unzip” command. I copied the zip file to a Solaris machine and strangely I can unzip it there.

The error message that I have while unzipin it under AIX 7 is:

Archive: xxxxxxxxxxxxxxx.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.

Can anyone help me understand why Ican do it under AIX ?

Thanks,

Shell request failed on channel 0

Hi everyone,

I’m trying to ssh from AIX to window servers using freeSSHD(on window) via PKI authentication. When i try to connect from aix, I get this message “shell request failed on channel 0” If i try sftp
“subsystem request failed on channel 0Connection closed”
I tried to fix this problem by debugging mode but I don’t know how i can fix this. Can anyone tell me what i did wrong?

Code:
OpenSSH_5.4p1, OpenSSL 0.9.8m 25 Feb 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Failed dlopen: /usr/krb5/lib/libkrb5.a(libkrb5.a.so): Could not load module /usr/krb5/lib/libkrb5.a(libkrb5.a.so).
System error: No such file or directory
debug1: Error loading Kerberos, disabling Kerberos auth.
debug2: ssh_connect: needpriv 0
debug1: Connecting to 11.11.1.111 [11.11.1.111] port 22.
debug1: Connection established.
debug2: key_type_from_name: unknown key type ‘—–BEGIN
debug2: key_type_from_name: unknown key type ‘—–END
debug1: identity file /home/sssmp/.ssh/id_rsa type 1
debug1: identity file /home/sssmp/.ssh/id_rsa-cert type -1
debug2: key_type_from_name: unknown key type ‘—–BEGIN
debug2: key_type_from_name: unknown key type ‘—–END
debug1: identity file /home/sssmp/.ssh/id_dsa type 2
debug1: identity file /home/sssmp/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version WeOnlyDo 2.1.3
debug1: no match: WeOnlyDo 2.1.3
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.4
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v00@openssh.com,ssh-dss…sh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,none
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,none
debug2: kex_parse_kexinit: zlib,none
debug2: kex_parse_kexinit: zlib,none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug2: dh_gen_key: priv key bits set: 129/256
debug2: bits set: 1041/2048
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host ‘11.111.1.11’ is known and matches the RSA host key.
debug1: Found key in /home/sssmp/.ssh/known_hosts:5
debug2: bits set: 1050/2048
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/sssmp/.ssh/id_rsa (20046808)
debug2: key: /home/sssmp/.ssh/id_dsa (2003fc68)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/sssmp/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp 93:f2:4d:36:52:e3:1c:03:91:c5:93:de:f7:75:50:d3
debug1: read PEM private key done: type RSA
***Build Server***debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug2: channel 0: request shell confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 131072 rmax 98304
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel_input_status_confirm: type 100 id 0
shell request failed on channel 0
From above result, i can see that i was able to make connection…not sure what is the meaning of channel….

Thanks in advance, let me know if i have to provide more info…
Source: The UNIX and Linux Forums

Maxuproc vs ulimit -u [processes(per user)]

Morning,

Somebody can tell me in AIX 6.1 what is the different between the maxuproc (lsattr -El sys0 | grep max) and the [processes(per user)] for a user.

Example:
Oracle is limited by :
#ulimit -u
processes(per user) unlimited

But lsattr -El sys0| grep maxuproc show me :
maxuproc 16384

So oracle is limited (number of process) or not ?

which of these command can i believe ? What is the real difference between these parameters ?

Thanks.
Source: The UNIX and Linux Forums

Calling functions from main program from dlopened library function

Hello All,

I am trying to call a function from the calling main program from a dlopened library function, below is the entire code, when I execute it it crashes with sigill. Can you guys help me out I guess I am missing out on the linker flag or something here. besides I am new to AIX and really appreciate your help on this.

Code:
# cat main.c
#include
#include
#include
#include
typedef void (*FP)(void);

void printme (void) {
printf (“printed me hurray!!!n”);
}

int
main( int argc, char** argv )
{
void* handle;
void* symptr;
FP fp;
/*** Load the shared object containing the definition of the ***/
/*** function . defsym(). ***/
if ( NULL == ( handle = dlopen( “./libdefsym.so”, RTLD_NOW ) ) ){
perror( dlerror() );
exit( 1 );
}
/**** Obtain the address of the function defsym. ***/
if ( NULL == ( symptr = dlsym( handle, “defsym” ) ) ) {
if ( 0 == errno ) {
fprintf( stderr, “Symbol defsym not found. Exitingn”
);
exit( 1 );
}
perror( dlerror() );
exit( 1 );
}
fp = ( FP )symptr;
/*** Call the function via the obtained function address. ***/
fp();
/*** Unload the previously loaded shared object. ***/
if ( 0 != ( dlclose( handle ) ) ) {
perror( dlerror() );
exit( 1 );
}
exit( 0 );
}

defsym.c
#include
#include
void
defsym()
{
printf( “defsym called.n” );
printme();
}

cat toexp.exp
#!.
printme

Makefile
CC=gcc
CFLAGS= -g -maix64
all: main libdefsym.so
main: main.o
$(CC) -maix64 -o main main.o
main.o: main.c
$(CC) $(CFLAGS) -c main.c
libdefsym.so: defsym.o
ld -G -bnoentry -bexpall -bE:toexp.exp -o libdefsym.so defsym.o -lc
defsym.o: defsym.c
$(CC) $(CFLAGS) -c defsym.c
.PHONY: clean
clean:
rm *.o *.so main

# dbx ./main core
Type ‘help’ for help.
[using memory image in core]
reading symbolic information …internal error: 1283-228 expected char ‘,’, found ‘;-31,448,256;;’
internal error: 1283-228 expected char ‘;’, found ‘,256;;’
internal error: 1283-232 index(“256;;”, ‘:’) failed
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘s__LC_locale:,1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: 1283-228 expected char ‘,’, found ‘__LC_locale:,1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: 1283-228 expected char ‘;’, found ‘_LC_locale:,1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: unexpected value 44 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘s_LC_locale_objhdl:,128,64;;’
internal error: 1283-228 expected char ‘,’, found ‘_LC_locale_objhdl:,128,64;;’
internal error: 1283-228 expected char ‘;’, found ‘LC_locale_objhdl:,128,64;;’
internal error: unexpected value 44 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘128,64;;’
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c

Illegal instruction (illegal opcode) in . at 0x0
warning: Unable to access address 0x0 from core
(dbx) where
.() at 0x0
internal error: 1283-228 expected char ‘,’, found ‘;-31,448,256;;’
internal error: 1283-228 expected char ‘;’, found ‘,256;;’
internal error: 1283-232 index(“256;;”, ‘:’) failed
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘s__LC_locale:,1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: 1283-228 expected char ‘,’, found ‘__LC_locale:,1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: 1283-228 expected char ‘;’, found ‘_LC_locale:,1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: unexpected value 44 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘1088,64;__meth_ptr:13,1152,64;__data_ptr:13,1216,64;;’
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘s_LC_locale_objhdl:,128,64;;’
internal error: 1283-228 expected char ‘,’, found ‘_LC_locale_objhdl:,128,64;;’
internal error: 1283-228 expected char ‘;’, found ‘LC_locale_objhdl:,128,64;;’
internal error: unexpected value 44 at line 5176 in file stabstring.c
internal error: 1283-228 expected char ‘,’, found ‘128,64;;’
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
internal error: unexpected value 120 at line 5176 in file stabstring.c
defsym(), line 8 in “defsym.c”
main(argc = 1, argv = 0x0ffffffffffff9e0), line 36 in “main.c”
(dbx)

Source: The UNIX and Linux Forums

Set LD_LIBRARY_PATH to empty issue

I have a question on setting environmental variable LD_LIBRARY_PATH.
The case is that, i cannot execute wget on my AIX machine.
It return the following error:

Code:
exec(): 0509-036 Cannot load program wget because of the following errors:
0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.8).
0509-150 Dependent module /usr/lib/libiconv.a(libiconv.so.2) could not be loaded.
0509-152 Member libiconv.so.2 is not found in archive
0509-022 Cannot load module wget.
0509-150 Dependent module /opt/freeware/lib/libintl.a(libintl.so.8) could not be loaded.
0509-022 Cannot load module .
After I unset the environmental variable LD_LIBRARY_PATH using unset command, wget can working properly.
Then I set the variable to “1”, wget also working properly.
Finally, I set it to “”, wget prompt the above error message again.
So, would you tell me what going on? and why wget can working even $LD_LIBRARY_PATH=”1″?

thank you very much
Source: The UNIX and Linux Forums