Operating System - HP-UX
1833302 Members
3069 Online
110051 Solutions
New Discussion

Unable to run inetd service as non-root user

 
Marc Riley
Occasional Contributor

Unable to run inetd service as non-root user

Hi there,
Anyone have any suggestions for this problem? We are testing a customers payroll application under HP-UX 11.11 (currently on 10.20). The app has an inetd service defined to respond on port 5200 as follows

/etc/services -
ouiserv 5200/tcp # CHRIS client server

/etc/inetd.conf -
ouiserv stream tcp nowait chriscs /usr/acuchris/ouinexec ouinexec

What we find is that running the service as a non-root user, we get the following error

[root:maggie]/root # telnet 0 5200
Trying...
Connected to 0.
Escape character is '^]'.
/usr/lib/dld.sl: Can't find path for shared library: libC.sl
/usr/lib/dld.sl: No such file or directory
Connection closed by foreign host.

When run as root it works okay. If we "su -" to the chriscs user, we can run the cmd okay also. Have also tested under HPUX 11.0 and the inetd service works fine as both root & non-root.

Is anyone aware of differences in inetd between 11.0 -> 11.11 ?? Or anything else that we should check?

Thanks
Marc
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: Unable to run inetd service as non-root user

Hi Marc,

Appears to me that you need the location of libC.sl in your SHLIB_PATH env variable.
I find that lib in /usr/lib on my 11.11 systems.
So do the following for that user

export SHLIB_PATH=/usr/lib:$SHLIB_PATH

then try it again. If it then works, add that to the user's .profile.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Dani Seely
Valued Contributor

Re: Unable to run inetd service as non-root user

Hey Marc,
Jeff beat me to your solution ... that should get the issue resolved. You may want to look deeper as to why the users profile is different, unless it is truly meant to have different PATH statements than other users. Still, check it out and see what's different.

Adding /usr/lib to the users $PATH should get you fixed right up. Good luck!
Together We Stand!
Bill Hassell
Honored Contributor

Re: Unable to run inetd service as non-root user

Actually, an inetd service gets no profile because it doesn't login. That means that ouinexec gets a very small environment (PATH, SHLIB_PATH, etc) that will NOT be the same as a login (su - chriscs). The program must be rewritten to explicitly set all required env values internally. The difference between 11.0 and 11.11 is unlikely due to the opsystem but possibly the env that inetd gets when it starts (/sbin/init.d/inetd/inetd). It may also be due to compile or linker options. You can also modify the executable with chatr to fix the shared library message (there may others later).


Bill Hassell, sysadmin
Dani Seely
Valued Contributor

Re: Unable to run inetd service as non-root user

Hello Marc,
I assume this is your first experience on the ITRC forum as you did not award points to the forumers for the answers you were provided. May I suggest that you take a look at the following link to learn about the points system in use here. Thanks.

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

Please read the article, assess the assistance you were provided by the forumers, then reward them. Thanks!
Together We Stand!
Marc Riley
Occasional Contributor

Re: Unable to run inetd service as non-root user

Thanks for the responses - have finally got around to assigning points.

None of these actually resolved the issue, but did give me the idea to write a wrapper scritp to capture information as the session was established.

For anyone interested, the issue was that under 11.11, a service run as a non-root user did not have a $PWD set. This was an issue because the binary was compiled with a non-absolute path to one of the libraries

../../../inst/lib/libC.sl

obviously impossible to get to without a working directory set initially.

The fix turned out to be the latest 11.11 su cumulative patch.

Thanks for all the replies
Marc