LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to start a process with specific uid/gid during bootup? (https://www.linuxquestions.org/questions/linux-software-2/how-to-start-a-process-with-specific-uid-gid-during-bootup-556098/)

senthilpr_in 05-23-2007 10:40 AM

How to start a process with specific uid/gid during bootup?
 
Hi all,

I have a process which I startup at boot time by adding the following line to my rc.local file

/usr/local/dcmtk/bin/dcmqrscp -c /home/db/dcmqrscp.cfg 2100 &

'dcmqrscp' is a server program, which receives files and writes them to a temp directory on disk. All Users can run a script which processes the files in this temp directory and deletes them after the processing is complete. The temp directory has 777 permission, but the files are created (by dcmqrscp) with a default permission of 644 and with the owner being root.

Should I start 'dcmqrscp' with a specific gid, to which all my users belong, so that they can delete the files in the temp directory, once they are done with their processing? What I'm looking for, is a way to make all the files created by 'dcmqrscp' program, world writeable, so that the script run by my users, will delete these files, once the processing is complete.

Thanks!

Senthil

rednuht 05-23-2007 04:07 PM

change the owner of the app to a user that has the required permissions and setuid the executable.
or change the owner of the folder and set setuid
read up on both of these http://en.wikipedia.org/wiki/Setuid

mattsoftnet 05-23-2007 04:10 PM

that's all you have to do? :confused:

so scripts and binaries run under whatever user owns the file?

hackintosh 05-23-2007 10:00 PM

u never know the danger of using SETGID and SETUID.

better pray your server dont break by others

mattsoftnet 05-23-2007 10:18 PM

Quote:

Originally Posted by hackintosh
u never know the danger of using SETGID and SETUID.

better pray your server dont break by others


then what is the right way to do it?

hackintosh 05-23-2007 11:22 PM

Quote:

Originally Posted by mattsoftnet
then what is the right way to do it?

as i mention in the security sub-forum, use sudo to instead of setuid or setgid.


All times are GMT -5. The time now is 09:32 AM.