LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
LinkBack Search this Thread
Old 06-30-2009, 11:26 PM   #1
xxx_anuj_xxx
Member
 
Registered: Jun 2004
Location: Bharat
Distribution: RedHat, Debian, FreeBSD, Fedora, Centos
Posts: 114

Rep: Reputation: 16
rsync solaris + ld.so.1: rsync: fatal: libiconv.so.2: open failed:


Hi,

OS=Sun 5.10 Generic_138888-08 sun4u

I have to copy some files on to an another SunOS box. To preserve the symbolic link I am using rsync.

/usr/local/bin/rsync -azuv /tmp/hi -e ssh asingh@busun067:/tmp/


With the rsync I am getting following error:
ld.so.1: rsync: fatal: libiconv.so.2: open failed: No such file or directory
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.5]

Lib files seems to be ok.

sun063:/.ssh# which rsync
/usr/local/bin/rsync
sun063:/.ssh# ldd /usr/local/bin/rsync
libpopt.so.0 => /usr/local/lib/libpopt.so.0
libsec.so.1 => /usr/lib/libsec.so.1
libiconv.so.2 => /usr/local/lib/libiconv.so.2
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libc.so.1 => /usr/lib/libc.so.1
libintl.so.8 => /usr/local/lib/libintl.so.8
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libavl.so.1 => /lib/libavl.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
sun063:/.ssh#

Any idea why? and resolution?

Thanks & Regards
Anuj Singh
 
Old 07-01-2009, 12:05 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,775

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
You can set the LD_LIBRARY_PATH env. variable. For bash:
Code:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
If you want this env. variable to be available for all users, you can put it in /etc/profile, using the following:
Code:
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

Last edited by bathory; 07-01-2009 at 12:10 AM.
 
Old 07-01-2009, 03:14 AM   #3
xxx_anuj_xxx
Member
 
Registered: Jun 2004
Location: Bharat
Distribution: RedHat, Debian, FreeBSD, Fedora, Centos
Posts: 114

Original Poster
Rep: Reputation: 16
rsync: fatal: libiconv.so.2: open failed:

bathory:

that seems not working either-

------------------------------------------
bash-3.00$ echo $LD_LIBRARY_PATH

bash-3.00$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
bash-3.00$ echo $LD_LIBRARY_PATH
/usr/local/lib:
bash-3.00$ rsync
ld.so.1: rsync: fatal: libiconv.so.2: open failed: No such file or directory
Killed
bash-3.00$ export LD_LIBRARY_PATH=/usr/local/lib
bash-3.00$ echo $LD_LIBRARY_PATH
/usr/local/lib
bash-3.00$ rsync
ld.so.1: rsync: fatal: libiconv.so.2: open failed: No such file or directory
Killed
bash-3.00$ uname -a
SunOS sun067 5.10 Generic_137111-06 sun4v sparc SUNW,T5240
bash-3.00$ ldd $(which rsync)
libpopt.so.0 => /usr/lib/libpopt.so.0
libsec.so.1 => /usr/lib/libsec.so.1
libiconv.so.2 => (file not found)
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libc.so.1 => /usr/lib/libc.so.1
libavl.so.1 => /lib/libavl.so.1
libmp.so.2 => /lib/libmp.so.2
libmd.so.1 => /lib/libmd.so.1
libscf.so.1 => /lib/libscf.so.1
libdoor.so.1 => /lib/libdoor.so.1
libuutil.so.1 => /lib/libuutil.so.1
libgen.so.1 => /lib/libgen.so.1
libm.so.2 => /lib/libm.so.2
/platform/SUNW,T5240/lib/libc_psr.so.1
/platform/SUNW,T5240/lib/libmd_psr.so.1
bash-3.00$

---------------------------------------------------

right now I've used tar + scp to preserve the soft links and ownership to copy. But surely I would like to know the reason of rsync problem.

Thanks & Regards
Anuj Singh
 
Old 07-01-2009, 03:37 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Are you logged as root when you run rsync ?
Where did you get these rsync binaries ?
They seems not to be correctly built.
 
Old 07-01-2009, 05:53 AM   #5
xxx_anuj_xxx
Member
 
Registered: Jun 2004
Location: Bharat
Distribution: RedHat, Debian, FreeBSD, Fedora, Centos
Posts: 114

Original Poster
Rep: Reputation: 16
rsync package:
bash-3.00$ pkginfo | grep rsyn
application SMCrsync rsync

rsync we can use as a normal user too(if it's an env variable issue) right?


Thanks & Regards
Anuj Singh
 
Old 07-01-2009, 08:08 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Are you logged as root when you run rsync and experience the issue ?
LD_LIBRARY_PATH is a hack and doesn't apply to root in that specific case as /usr/local/lib isn't a trusted directory anyway.

Last edited by jlliagre; 07-01-2009 at 08:16 AM.
 
Old 07-01-2009, 10:05 AM   #7
xxx_anuj_xxx
Member
 
Registered: Jun 2004
Location: Bharat
Distribution: RedHat, Debian, FreeBSD, Fedora, Centos
Posts: 114

Original Poster
Rep: Reputation: 16
jlliagre:

I tried with root as well as normal system account. same error.

sun067:/# rsync
ld.so.1: rsync: fatal: libiconv.so.2: open failed: No such file or directory
Killed
sun067:/# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
sun067:/# rsync
ld.so.1: rsync: fatal: libiconv.so.2: open failed: No such file or directory
Killed
sun067:/# export LD_LIBRARY_PATH=/usr/local/lib
sun067:/# rsync
ld.so.1: rsync: fatal: libiconv.so.2: open failed: No such file or directory
Killed
busun067:/#

Last edited by xxx_anuj_xxx; 07-01-2009 at 10:09 AM. Reason: added standard I/O
 
Old 07-01-2009, 10:29 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,775

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
You can install the rsync package from sunfreeware (along with the dependencies you miss) and either remove SMCrsync, or use the LD_LIBRARY_PATH hack to use first the libraries in /usr/local/lib
 
Old 07-01-2009, 11:34 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
As I already wrote, the LD_LIBRARY_PATH hack doesn't work for root.

You might use instead:
Code:
crle -u -l /usr/local/lib -s /usr/local/lib
Beware that a mistake made using the crle command migth make your system unusable.
Please read carefully the crle manual page before using it, especially the part explaining how to revert to a working system after setting a bogus library path:
Code:
LD_NOCONFIG=yes rm /var/ld/ld.config
Edit:
Hmm: it looks like the LD_NOCONFIG feature is only in Solaris Express based releases ...

Last edited by jlliagre; 07-01-2009 at 11:39 AM.
 
Old 07-03-2009, 10:54 PM   #10
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 748
Blog Entries: 6

Rep: Reputation: 74
if you dont mind lib trusted or not , add all lib in your system with crle

Code:
crle -l /lib:/usr/lib:/usr/local/lib:/usr/sfw/lib:/usr/openwin/lib/
or any lib u may know. this work for me on sparc
 
Old 07-16-2009, 06:43 AM   #11
roger_v
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Rep: Reputation: 0
I have the same problem and need to solve it rather urgently.
I removed the older SMCrsync, then installed prerequisite packages and the latest rsync-3.0.6 as a package.
I used LD_LIBRARY_PATH with and without ld.config created with crle, all to no avail.
By setting LD_DEBUG I can see that the linker does find the libiconv.so.2 when invoking rsync, but still rsync fails with ld.so.1 fatal error complaining about no such file libiconv.so.2:
16877: BASE: file=libiconv.so.2; needed by /usr/local/bin/rsync
16877: BASE:
16877: BASE: find object=libiconv.so.2; searching
16877: BASE: search path=/usr/local/lib:/usr/local/lib/sparcv9:/lib/64:/usr/lib/64:/opt/SUNWspro/lib:/usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/lib/X11:/usr/ucb/lib:/opt/SUNWconn/x25/lib:/usr/ccs/lib:/usr/sfw/lib:/opt/SUNWmlib/lib:/usr/sadm/lib:/usr/xpg4/lib:/usr/platform/sun4u/lib (LD_LIBRARY_PATH)
16877: BASE: trying path=/usr/local/lib/libiconv.so.2
16877: BASE: file=/usr/local/lib/libiconv.so.2 [ ELF ]; generating link map
16877: BASE: dynamic: 0xff18ba58 base: 0xff080000
16877: BASE: size: 0x10e000 entry: 0xff080094
16877: BASE: lmid: BASE lmco: 0xc
16877: BASE:
16877: BASE: version needed processing: file=/usr/local/bin/rsync
16877: BASE: file version
16877: BASE:
16877: BASE: file=/usr/local/bin/rsync; add binding to:
16877: BASE: file=/usr/local/lib/libiconv.so.2 [ NEEDED ]
16877: BASE:


Anyone managed to solve this problem? I'm getting pretty desperate ...
I have solaris 5.10, update 7 (May 2009)
thanks!
 
Old 07-16-2009, 07:11 AM   #12
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
What says:
Code:
file /usr/local/lib/libiconv.so.2
file /usr/local/bin/rsync
By the way, this rsync binary is somewhat broken as it demands libiconv which isn't really required under Solaris.
The iconv functions are already included in Solaris libc.
 
Old 07-16-2009, 07:26 AM   #13
roger_v
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Rep: Reputation: 0
/usr/local/lib/libiconv.so.2: ELF 32-bit MSB dynamic lib SPARC Version 1,
dynamically linked, not stripped, no debugging information available

/usr/local/bin/rsync: ELF 32-bit MSB executable SPARC Version 1,
dynamically linked, not stripped


Could the problem be a bogus error message from rsync?
I am running it over ssh, the error might come from ssh dependencies?
 
Old 07-16-2009, 09:20 AM   #14
roger_v
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Rep: Reputation: 0
additional information: when I run
Code:
ssh remoteuser@remotehost -i /path/to/my/dsa-key /bin/true > test.dat
then I am getting an empty file, so I assume my shell is clean, even though actually logging in with ssh does generate many echo messages on the remote machine.

For the actual rsync command I have used 2 approaches:
Code:
rsync -avz -e "ssh -i /path/to/my/dsa-key" remoteuser@remotehost:/remote/dir /this/dir/
and
Code:
rsync --compress --rsh=/usr/local/bin/ssh --recursive --times --perms --links remoteuser@remotehost:/remote/dir /this/dir/
both are failing...
 
Old 07-16-2009, 10:11 AM   #15
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Quote:
Originally Posted by roger_v View Post
additional information: when I run
Code:
ssh remoteuser@remotehost -i /path/to/my/dsa-key /bin/true > test.dat
then I am getting an empty file, so I assume my shell is clean
I assume the test.dat file is local so you aren't really testing the whole chain. A failed command would also produce an empty file. Better to run something like:
Code:
ssh -i /path/to/my/dsa-key  remoteuser@remotehost hostname > test.dat
and see if the remote hostname shows up in test.dat.

About the main rsync issue, it is quite possible rsync has its dependencies fixed on the local side but not on the other one. The LD_LIBRARY_PATH hack is not an option for the remote command, unless you wrap rsync with a custom script. You really should check you set crle correctly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync gives chgrp failed errors jjge Linux - Software 5 09-29-2008 03:23 PM
failed rsync yusufs Linux - Newbie 1 01-05-2008 03:01 PM
How can I uninstalled libiconv? libiconv.so.2: cannot open shared object file abefroman Linux - Software 2 11-03-2006 03:07 PM
rsync between Solaris and Linux xpucto Solaris / OpenSolaris 1 12-01-2005 12:51 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration