Operating System - HP-UX
1855647 Members
7786 Online
104113 Solutions
New Discussion

Re: su - startup applications fail

 
SOLVED
Go to solution
Jerry Holen
New Member

su - startup applications fail

We use the 'su - user -c "start_application"' command extensively to start various applications during machine reboot. There are certain applications which start successfully, as noted in various log files (application and system), but fail shortly after startup - with no indication on why they fail. This ONLY happens when executed from the root user - and those applications that fail will always fail. Those identical su commands, when executed from a user other than root, seem to always work.

Anybody have a clue as to what is happening or where we can look futher?

Thanks in advance...jerry
4 REPLIES 4
James Odak
Valued Contributor

Re: su - startup applications fail

given more detail, perhaps someone would be able to help more
from what you have given me
my only suggestion is to check the entire flow of your scripts
look for hard exits and other su commands with in the su command
examples i've seen
processes started in the back ground followed by if then statements ending with an exit

if you can attach one for the scripts thats failing


Jim
Tracey
Trusted Contributor

Re: su - startup applications fail

I know from past experience that our "regular" users have all the environment variables set in their profile but root does not. It could be that this your case also, and you need to make sure root has all the environment variables needed in your scripts.
James R. Ferguson
Acclaimed Contributor

Re: su - startup applications fail

Hi Jerry:

> Make sure that any associated services are available when you code startup scripts. In general, run-level 3 is the appropritate place for applications to be started. See "HP-UX 10.x Startup and Configuration (HP-UX 10.x)" for details:

http://docs.hp.com/hpux/onlinedocs/os/startup.pdf

If you are using these features, check the /etc/rc.log (and/or /etc/rc.log.old) for messages from the startup sequence.

> Make sure that all environmental variables needed for your script are defined in the environment in which you start it. You show the use of 'su - -c <script>'. This is correct, when you want to source the 's $HOME/.profile before executing the command (-c) script.

...JRF...
Joel Shank
Valued Contributor
Solution

Re: su - startup applications fail

Hi Jerry

We had a similar problem when trying to start some of our Sybase applications. We solved the problme by beginning the su command with a nohup:
/usr/bin/nohup /usr/bin/su - ID -c "command"

This seemed to have fixed our problem.

Hope this helps --- jls