Jump to content


Photo
- - - - -

V5 /bin/sh workaround on Fedora


4 replies to this topic

#1 JC Jones

JC Jones

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 09 October 2009 - 11:05 PM

PROIV Version 5.0 (Green Screen)
Currently on Red Hat 7.3

Looking at migrating from Red Hat 7.3 to Fedora 10. Already worked around the obvious libc and libm issues by creating a compatible environment using the LD_LIBRARY_PATH environment variable and setting up older versions of of the needed libraries (libm-2.2.5, libc-2.2.5, and ld-2.2.5). Also fixed the same problem with Iscollect by instructing it to run in the alternate compatible libraries environment. The application runs but displays errors sporratically when attempting to use /bin/sh. Obviously I can't change the /bin/sh symlink to an older version so I tried making /bin/sh a script that looked for PROIV only set environment variables and did an exec to an older version of sh that is compatible with the 2.2.5 libraries. That got rid of the errors in PROIV but still cannot print (everything else seems to work fine). However, the system will not boot without /bin/sh being a direct symlink to /bin/bash which requires the 2.9 libraries. Kind of a catch 22. Had to boot from a live CD and restore /bin/sh to the symlink directly to /bin/bash to get the system to boot again.

Does anybody have any ideas how to work around this issue. I cannot find anywhere in the PRO-IV config where I can tell it to use a different path for sh, /bin/sh appears to be hardcoded somewhere in the binaries but I could not find that string anywhere in the pro binary.

Also, if anybody has any idea why it might not be printing either using lp or lpr (I've tried updating PROIV to use lpr -P which does work from the command line even when using the compatible environment).

Thanks,
JC Jones

#2 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 11 October 2009 - 02:57 PM

> /bin/sh appears to be hardcoded somewhere in the binaries

Actually I think "/bin/sh", is by (POSIX etc.) definition, specifically executed when the standard C library function "system()" is used. And that is how PROIV will implement its SYSTEM() command in logic. So I think there's nothing you can do there, it may well be a security/subversion issue.

Is it not possible to set up the library search path so that both your old PROIV kernel and the shiny new /bin/bash will be able to find the library versions that they need? Aren't those searches versioned? Guess I've forgotten precisely how that works B)

No idea about the printing, sorry.
Nothing's as simple as you think

#3 JC Jones

JC Jones

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 12 October 2009 - 03:29 PM

Essentially that's how I got PRO-IV to use the correct libraries to execute, but /bin/sh (and /bin/bash) also use libm.so.6 and libc.so.6 which for PRO-IV must be a symlink to libm-2.25.so and libc-2.2.5.so but for all of the Fedora programs it must be a symlink to libm-2.9.so and libc-2.9.so currently. By setting up a separate legacy library path and prefixing $LD_LIBRARY_PATH with the path to the legacy library files proiv executes fine, and other applications like lpr, lp, etc. can also be in that path or wrappers built in that path. This does not work however with sh since /bin/sh is specifically called instead of just searching the path for sh (which would execute the sh that is in the legacy library and bin path I have set up and would work perfectly).

I was actually able to write a wrapper around /bin/sh that called the correct legacy sh (and used the correct legacy libraries) if the right environment variable was set and called /bin/bash if not. By all tests that was working great until a reboot was attempted and unless /bin/sh is a direct symlink to /bin/bash Fedora will not boot, and in fact won't even allow a second screen or remote login either so I had to boot to a live cd, mount the root file system, fix the symlink for /bin/sh and then reboot to get the system running again.

I realize this is much more of a linux and operating system issue then a PRO-IV issue, I was just hoping that somebody else had wanted to move V5 to a newer operating system and had previously worked through some of these issues. Those that are still running V5 (from Rob's poll I see that the majority of people are still on V5), what linux distributions and versions are you using?

JC Jones

#4 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 368 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

Posted 13 October 2009 - 04:51 PM

Essentially that's how I got PRO-IV to use the correct libraries to execute, but /bin/sh (and /bin/bash) also use libm.so.6 and libc.so.6 which for PRO-IV must be a symlink to libm-2.25.so and libc-2.2.5.so but for all of the Fedora programs it must be a symlink to libm-2.9.so and libc-2.9.so currently. By setting up a separate legacy library path and prefixing $LD_LIBRARY_PATH with the path to the legacy library files proiv executes fine, and other applications like lpr, lp, etc. can also be in that path or wrappers built in that path. This does not work however with sh since /bin/sh is specifically called instead of just searching the path for sh (which would execute the sh that is in the legacy library and bin path I have set up and would work perfectly).

I was actually able to write a wrapper around /bin/sh that called the correct legacy sh (and used the correct legacy libraries) if the right environment variable was set and called /bin/bash if not. By all tests that was working great until a reboot was attempted and unless /bin/sh is a direct symlink to /bin/bash Fedora will not boot, and in fact won't even allow a second screen or remote login either so I had to boot to a live cd, mount the root file system, fix the symlink for /bin/sh and then reboot to get the system running again.

I realize this is much more of a linux and operating system issue then a PRO-IV issue, I was just hoping that somebody else had wanted to move V5 to a newer operating system and had previously worked through some of these issues. Those that are still running V5 (from Rob's poll I see that the majority of people are still on V5), what linux distributions and versions are you using?

JC Jones


stop me if this is too obvious but can't you run a post-boot script to enable your chosen shell?
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.

#5 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 23 October 2009 - 12:29 PM

> libm.so.6 and libc.so.6 which for PRO-IV must be a symlink to libm-2.25.so and libc-2.2.5

That bit doesn't make sense to me. Why would PRO-IV be trying to link the *.6 libraries?
Nothing's as simple as you think



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users