LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [Multiuser Runlevel] executing a process with a defined user (https://www.linuxquestions.org/questions/linux-software-2/%5Bmultiuser-runlevel%5D-executing-a-process-with-a-defined-user-312489/)

MD3 04-12-2005 01:54 PM

[Multiuser Runlevel] executing a process with a defined user
 
hi :)
i'd like to know how to have a user (e.g. my_user) to execute a command (e.g. my_server_start) when in multiuser mode... it means by writing the needed lines in /etc/rc.M

my system is slackware 10.0 with linux 2.4.26

thanks.. and bye ;)

Technoslave 04-12-2005 02:12 PM

In the init script that is used to start whatever you're wanting to start. When the actual application is being run, put an su - user_id -c command

Example, say you want to run the service foo, normally it might just appear on the line like this

foo

You'll want to run it as joe, so it would now look like:

su - joe -c foo

***

The other option of course is to look at the program itself and see if it has some way to execute itself as a different user - some apps do this.

MD3 04-12-2005 02:23 PM

won't this ask someone somewewre for a password? ;)

thanks


All times are GMT -5. The time now is 01:25 PM.