Operating System - HP-UX
1833829 Members
1995 Online
110063 Solutions
New Discussion

Need to run the 3 processes as a non-root user.

 
Amruth
Regular Advisor

Need to run the 3 processes as a non-root user.

All,

I have to test an application whether it works with another user account or not. Now the process related to this are running with root.

What should i do.

I have seen the related scripts in rc3.d directory.

Thanks for the help.
AM
If i am doing the same way you are doing to me then what is the difference between us.
3 REPLIES 3
John Payne_2
Honored Contributor

Re: Need to run the 3 processes as a non-root user.

Amruth,

Have you tried

"/usr/bin/su - nonrootuser -c '/path/to/startup/script'"

in the startup script?

This should start the procs as the non-root user.

Hope it helps

John
Spoon!!!!
Amruth
Regular Advisor

Re: Need to run the 3 processes as a non-root user.

These are the processes which should use the user "amruth" to start, run and stop.

lrwxr-xr-x 1 root sys 20 Nov 4 20:08 S991detectd -> /sbin/init.d/detectd
lrwxr-xr-x 1 root sys 19 Nov 4 20:08 S991uagent -> /sbin/init.d/uagent
lrwxr-xr-x 1 root sys 19 Nov 4 20:08 S991uvserv -> /sbin/init.d/uvserv
If i am doing the same way you are doing to me then what is the difference between us.
John Payne_2
Honored Contributor

Re: Need to run the 3 processes as a non-root user.

Inside each of those startup scripts, there is a section under 'start', where these scripts are actually starting things. Change the script from, say:

'/path/to/script/jjp.start'

to:

'/usr/bin/su - amruth -c '/path/to/script/jjp.start'

If you need more help, you would have to provide the contents of your scripts in /sbin/init.d. (I wouldn't recommend posting it if the information is sensitive in any way.)

John
Spoon!!!!