How do I run apps as a non-root user in redhat 6/7 ?

TIMFOX123
TIMFOX123 used Ask the Experts™
on
in the past I just let the install rpm set up an non root userid for an application.  
 
Where I am now we download source need to run it as non-root user without the RPM package taking care of this for me.
This is for newer versions of Redhat !

Does the rpm su to the user, runuser user another way of running an app ( apache, tomcat etc ) as a non-root user?

Regards;
Timfox123
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Nick UpsonPrincipal Operations Engineer

Commented:
you need to "su" to root or equivalent like sudo and then install / run as root

the rpm cannot su as there are too many different ways to validate
Top Expert 2007

Commented:
Can you elaborate more on requirement? Can you give example?
Distinguished Expert 2017
Commented:
I think this deals with setting up the run scripts
you would need to create a run script ref example /etc/init.d chkconfig line deals with when the service should start (which run levels) and similarly which run levels it should stop. ....

you need to include the requisite parameters in the start script to indicate that the app has to run using a non-root user after you create the non-root user that will be used by this app.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial