[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 ;) |
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. |
won't this ask someone somewewre for a password? ;)
thanks |
All times are GMT -5. The time now is 01:25 PM. |