Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  Installation partially fails for libiconv1.a in AIX 7.1

    Posted Tue April 14, 2020 03:50 PM

    Originally posted by: Canuck719


    My OS is AIX 7.1

    # rpm -ivh libiconv-1.14-2.aix6.1.ppc.rpm
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:libiconv-1.14-2                  ################################# [100%]
    add shr4.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
    add shr.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
    ar: Cannot open or remove a file containing a running program.
    ar: 0707-113 The fopen system call failed on file libiconv.a.
    add shr4_64.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
    ar: Cannot open or remove a file containing a running program.
    ar: 0707-113 The fopen system call failed on file libiconv.a.

     

     

    I've tried to clean the kernel and library memory before installation.

    #  slibclean

     

    I do see that there processes using this file as shared library.

    What would be the proper way to install this package successfully.

    THis is an LPAR.

     

    hna2tegh:/home/oracle/ghostscript# fuser -uVx /usr/lib/libiconv.a
    /usr/lib/libiconv.a:
    vfs             1966200s(root)
    vfs             2359324s(d_mock)
    vfs             3276948s(root)
    vfs             3342438s(root)
    vfs             3997878s(d_mock)
    vfs             4063344s(root)
    vfs             4390918s(d_mock)

     

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 2.  Re: Installation partially fails for libiconv1.a in AIX 7.1

    Posted Wed April 15, 2020 03:48 AM

    Originally posted by: AyappanP


    Paste the output of these commands.

    # cksum libiconv-1.14-2.aix6.1.ppc.rpm

    # ls -l libiconv-1.14-2.aix6.1.ppc.rpm

    #rpm -qp --scripts libiconv-1.14-2.aix6.1.ppc.rpm


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 3.  Re: Installation partially fails for libiconv1.a in AIX 7.1

    Posted Wed April 15, 2020 02:00 PM

    Originally posted by: Canuck719


    hna2tegh:/home/oracle/ghostscript# cksum libiconv-1.14-2.aix6.1.ppc.rpm
    3046615683 1585171 libiconv-1.14-2.aix6.1.ppc.rpm
    hna2tegh:/home/oracle/ghostscript# ls -ltr libiconv-1.14-2.aix6.1.ppc.rpm
    -rw-r--r--    1 root     system      1585171 Apr 06 12:01 libiconv-1.14-2.aix6.1.ppc.rpm
    hna2tegh:/home/oracle/ghostscript# rpm -qp --scripts libiconv-1.14-2.aix6.1.ppc.rpm
    postinstall scriptlet (using /bin/sh):
    # we need to include all shared members of the system wide /usr/lib/libiconv.a
    # at rpm installation time to avoid core dump of system binaries

    export AR="/usr/bin/ar -X32_64"

    /usr/bin/mkdir -p /tmp/libiconv.tmp
    cd  /tmp/libiconv.tmp
    LIST=`${AR} -t /usr/lib/libiconv.a`
    ${AR} -x /usr/lib/libiconv.a
    /usr/bin/strip -X32_64 -e *
    /usr/bin/cp -f /opt/freeware/lib/libiconv.a .
    for i in ${LIST}
    do
       if [ "$i" != "libiconv.so.2" ]; then
         echo "add $i shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a"
        ${AR} -r libiconv.a ${i}
       fi
    done
    /usr/bin/cp -f libiconv.a /opt/freeware/lib/libiconv.a
    cd -
    /usr/bin/rm -rf /tmp/libiconv.tmp
    hna2tegh:/home/oracle/ghostscript#

     


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 4.  Re: Installation partially fails for libiconv1.a in AIX 7.1

    Posted Thu April 16, 2020 04:11 AM

    Originally posted by: AyappanP


    The script copies (with --force option ) /opt/freeware/lib/libiconv.a in a temporary directory and adds the shared objects already extracted from AIX base /usr/lib/libiconv.a

    Not sure why "ar" command throws the fopen error since it is executed on the temporary libiconv.a file (which will be not loaded by any process ).

    Unable to re-create this issue in our side. 

     

    Just check the contents of /opt/freeware/lib/libiconv.a 

    # /usr/bin/ar -X32_64 -tv /opt/freeware/lib/libiconv.a
    rwxr-xr-x   205/1     1162902 Jun 11 04:47 2019 libiconv.so.2
    rwxr-xr-x   205/1     1200110 Jun 11 04:46 2019 libiconv.so.2
    rwxr-x---     0/0     117276 Dec 04 07:36 2019 shr4.o
    rwxr-x---     0/0     117526 Dec 04 07:36 2019 shr.o
    rwxr-x---     0/0     159410 Dec 04 07:36 2019 shr4_64.o

    If shr.o, shr4_64.o are missing, then you have to manually extract them from AIX base libiconv and put it here. 
     


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 5.  Re: Installation partially fails for libiconv1.a in AIX 7.1

    Posted Thu April 16, 2020 11:04 AM

    Originally posted by: Canuck719


    Thank you AyappanP, your idea of manually copying worked. Here is what I've done.

    # /usr/bin/mkdir -p /tmp/libiconv.tmp
    # cd /tmp/libiconv.tmp

    /usr/bin/ar -X32_64   -t /usr/lib/libiconv.a

    # /usr/bin/ar -X32_64   -tv /usr/lib/libiconv.a
    r--r--r--     2/2     237919 Jan 02 20:43 2019 shr4.o
    r--r--r--     2/2     238041 Jan 02 20:43 2019 shr.o
    r--r--r--     2/2     310767 Jan 02 20:43 2019 shr4_64.o

    #  /usr/bin/ar -X32_64 -tv /opt/freeware/lib/libiconv.a
    rwxr-xr-x   205/1     1162902 Jun 11 04:47 2019 libiconv.so.2
    rwxr-xr-x   205/1     1200110 Jun 11 04:46 2019 libiconv.so.2
    r--r--r--     0/0     237919 Apr 14 14:33 2020 shr4.o

    # /usr/bin/ar -X32_64 -x /usr/lib/libiconv.a # To get the files extracted into temp dir
    # chmod 750 shr.o shr4_64.o shr4.o
    # ls -ltr
    total 1552
    -rwxr-x---    1 root     d_mock       237919 Apr 16 09:20 shr4.o
    -rwxr-x---    1 root     d_mock       238041 Apr 16 09:20 shr.o
    -rwxr-x---    1 root     d_mock       310767 Apr 16 09:20 shr4_64.o

     

    #Missing files are shr.o, shr4_64.o in /opt/freeware/lib/libiconv.a

    # I'm adding all 3 files with proper permissions

    # Adding files to the archive manually
    /usr/bin/ar -X32_64 -r /opt/freeware/lib/libiconv.a  shr4.o
    /usr/bin/ar -X32_64 -r /opt/freeware/lib/libiconv.a shr.o
    /usr/bin/ar -X32_64 -r /opt/freeware/lib/libiconv.a shr4_64.o


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 6.  Re: Installation partially fails for libiconv1.a in AIX 7.1

    Posted Thu April 16, 2020 11:26 AM

    Originally posted by: AyappanP


    sounds good. Thanks


    #AIX-Open-Source-Software
    #AIXOpenSource