[Twisted-Python] Switch to a different uid/gid after binding reserved ports

Richard Townsend richard at starfighter.freeuk.com
Sun Jun 8 07:46:46 MDT 2003


> You can specify keyword arguments to Application's constructor.
>
>	a = Application(uid=1001, gid=1001)

> Then, call either the setUID or setEUID method of your Application 
> instance.  You will need to call bindPorts before calling these 
> methods, however.

Thanks for the info - it was the bindPorts() call I was missing - now it
works OK! 

It didn't seem to matter (in my test program) if I called bindPorts() before
or after listenTCP() - is there a preference?

> Can you detail what about twistd is incompatible with your system 
> architecture?  If your system is deployed for a long period of time, 
> chances are you are going to find that you require more and more 
> features from twistd and re-implement it one feature at a time.

Our system uses a home-grown process controller application to start
background processes. If it receives a SIGCHLD, it restarts the application.
It appears to me that when you run twistd, it forks a new process and the
original twistd dies. Our controller would then keep trying to restart it...



-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 2252 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20030608/df701efc/attachment-0002.bin>


More information about the Twisted-Python mailing list