LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How can root start programs in the name of other users? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-root-start-programs-in-the-name-of-other-users-92050/)

J_Szucs 09-12-2003 12:40 PM

How can root start programs in the name of other users?
 
I need that because postgreSQL cannot be started by root during the boot process.

crabboy 09-12-2003 12:52 PM

Use the su command.
Code:

su - username -c "command"
The -c tells the users shell to run command "command"

J_Szucs 09-12-2003 01:57 PM

Great. I knew it is possible.
But do I have to issue 'exit' somehow afterwards, to become root again?

crabboy 09-12-2003 01:59 PM

No, as long as the program you are launching can correctly daemonize itself.


All times are GMT -5. The time now is 12:06 AM.