Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rc.d script

Status
Not open for further replies.

paynerobert

Programmer
Joined
Jul 10, 2003
Messages
2
Location
US
I have a startup script on Solaris 8 which is to start a daemon as a particular user. In my rc script I have:

su - gooduser -c "abinary args"

Now, gooduser has bash set in /etc/passwd as its shell. The problem I'm seeing is that Solaris won't pick up gooduser's environment. After reading the man page I'm pretty sure it's because gooduser doesn't have /bin/sh as its shell. Changing the shell for gooduser is not an option.

One solution I see is to write a bash wrapper and source gooduser's profile to pick up the environment.

Any more elegent ideas?

 
Have you tried something like this:

su - gooduser -c ". /export/home/gooduser/.profile;abinary args"
 
Thanks for the reply. Exactly what I did, sourced the .profile after converting it to be /bin/sh compatible.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top