|
|
Starting a process as another user during system startup - Linux
|
Views : 393
|
|
Tagged in : Linux
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
If you want to start a process during the system start then you can put that command to invoke that process in /etc/rc.local ( commands in /etc/rc.local will be executed after the init scripts are executed and system is ready to work).The process invoked using /etc/rc.local will have the root ownership.Now what can you do if want to inovke a process of a another user ( except root ).You use the following command to do this :
su <username> -c 'command-to-inovke-the-process'
example :
su hiox -c 'sh starttomcat.sh'
The above coomand will start the tomcat which will run under user hiox |
|
By Selva, On - 2009-11-25 |
|
|
|