[Twisted-web] default file creation when using reactor.spawnProcess

Stephan schenette at gmail.com
Mon Aug 29 12:50:24 EDT 2011

HI Glypyh,

I'm using Ubuntu currently,

what I'm trying to accomplish is changing the default file creation
for the daemon, which from what I'm reading was changed some time ago.


what I'd like is for the twistd daemon to create files with a certain
default file creation permission, so I'm looking at changing the
but so far I can't get the format correctly, as I'm trying to use what
I'd normally use for chmod

when starting twistd what is the correct format for umask? is what I
have correct?
desired result is rw for owner, group and world.

 21 DAEMON_OPTS="--umask=0666 --pidfile=${PIDFILE}
--logfile=${LOGFILE} --python     ${SERVICE_PATH}"
 23 # Set python path so twistd can find the plugin
 24 # See: http://twistedmatrix.com/projects/core/documentation/howto/plugin.htm
 27 if [ ! -x $DAEMON ]; then
 28   echo "ERROR: Can't execute $DAEMON."
 29   exit 1
 30 fi
 32 if [ ! -x $SERVICE_PATH ]; then
 33   echo "ERROR: Can't execute: $SERVICE_PATH"
 34   exit 1
 35 fi
 37 start_service() {
 38   echo -n " * Starting $SERVICE_NAME... "
 39   start-stop-daemon -Sq --chuid ${RUNAS} --group ${RUNAS} -p

On Mon, Aug 29, 2011 at 9:45 AM, Glyph Lefkowitz
<glyph at twistedmatrix.com> wrote:
> On Aug 29, 2011, at 8:20 AM, Stephan wrote:
> I still have the issue, but I've found out that it has something to do
> with the fact that the twisted daemon isn't starting as the user I've
> asked it to start as.
> The --chuid flag to start-stop-daemon is not seen by twistd; twistd is
> started by start-stop-daemon allegedly already running as that user.  If
> this is a bug, it's a bug in your platform's startup-management tools, not
> Twisted itself.
> Note that os.environ['USER'] is informational only and does not represent
> the actual current user.  Look at os.getuid() for the real number.
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

More information about the Twisted-web mailing list