Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello!
This is the problem:
I have a process that runs as non root but after I reboot the computer the process restarts as root. I have changed the owner of my startscripts in init.d directory from root to my user but it didn't help.
It is probably some simple thing I have to do but I'm lost here. Please give me a hint :-)

Hello,
The first thing is to tell you that the ownership of one file does not fix the user that the process asociated to this file runs as (for example, change the mode of any binary file to 777 and execute it with any user diferent from the owner and see what it happens).
I think that the startup scripts are always run as root (but Iīm not sure) so you could modify the starting script to include an su to the desired user (the command is: "su - desired_user") before the line that runs the process. To test this without shuting down, run the startup script as root and see if the final process is run as the user you want.
Bye,
Joseba M. Iturbe

Thanks Joseba for your quick answer.
One problem though.
I get the message "No Directory!"
when I use the su command. Does this mean that I have not specified the home directory for that particular user and does the su command fail in that case?regards Stefan

Hello again,
Seems like this user does not have a home directory or itīs wrong specified at /etc/passwd. But, does the su command fail? Iīm not sure but I think that it works even if the directory is not present (you can see who runs the process with ps -efa).
I think that you can avoid the creation and the use of this home using the su command without the colon, that is, su desired_user instead of su - desired_user. This way you tell the OS to switch the user but using the environment of the user that is issuing the su command (in this case root).
Test it and see if it mets your needs. If not, create the userīs home and use su -.
Bye,
jmiturbe

![]() |
timestamp formatting
|
script for date search
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |