[wellylug] Proper way to start program with correct uid from init.d?

Tim Nicholas tim at nicholas.net.nz
Wed May 5 00:22:08 NZST 2004


On 05/03/04 18:06, Damon Lynch wrote:
> Hi,
> 
> On Mon, 2004-05-03 at 09:36, Sam wrote:
> 
>>What distribution are you using?
> 
> 
> Mandrake.
> 
> 
>>Debian has a utility called 'start-stop-daemon' which is used in various
>>init.d scripts for .. well .. starting and stopping daemons. :)
>>
>>It has quite a few funky parameters you can pass to it, including:
>>
>>-c|--chuid username|uid
> 
> 
> This seems very handy.  I will look into this.  Thanks very much!
> 
> Damon
> 
> 

You might just be able to start it using "su -c 'command' user"

eg.

su -c 'vncserver :1 -depth 16 -geometry 640x480 2>/dev/null 1>&2 && 
success || failure' zope

or something like that.

Tim

-- 
Tim Nicholas                          ||                      Cilix
Email: tim at nicholas.net.nz            ||    Wellington, New Zealand
http://tim.nicholas.net.nz/           ||   Cell/SMS: +64 21 337 204




More information about the wellylug mailing list