[Twisted-Python] twistd and serial port access
Hi everyone, I'm stumped by the following problem with using pyserial from within twistd. (assuming I'm invoking twistd from the cmd line as uid=1000 gid=100 and I'm using pyserial to connect to /dev/ttyS01 which have permissions 666, owner 'root', grp 'uucp' ) In myserialapp.py I have created an application object (I want the daemon to run as uid 1000): application=service.Application('serial',uid=1000,gid=100) When I run : twistd -ny myserialapp.py >/dev/null & - no problem whatsover. BUT when I run: twistd -y myserialapp.py - pyserial squeels about the serialport "not being a valid file descriptor." I'm convinced that it has someting to do with permissions when twistd enters daemon mode - but what and how do I fix that? regards, Eugene Coetzee Web -> www.reedflute.com ===============================================
On Tue, 2004-11-16 at 22:38 +0200, Eugene Coetzee wrote:
I'm convinced that it has someting to do with permissions when twistd enters daemon mode - but what and how do I fix that?
Use a service that hooks up to the serial port in its priviligedStartService method, which will run as root.
participants (2)
-
Eugene Coetzee
-
Itamar Shtull-Trauring