Re: [tuxdroid-user] Tuxdroid ans slug (NSLU2)
Status: Beta
Brought to you by:
ks156
From: Philippe T. <ph...@te...> - 2007-04-18 21:35:06
|
> Big diffs: much more mprotect calls, pthreads seem different (and ps ax > shows me the 4 "threads" on the slug) > Mmm seems this has to to with pthreads. I commented out the setuid() setgid() and now the tcp part starts too. I can connect from python but I cannot do anything there and even not ctrl-c to quit. From daemon logs I can see many client 0 connected client 0 connected I've to kill -9 python The script I tried: #!/usr/bin/python import sys sys.path.append('/opt/tuxdroid/api/python') from tux import * tux.cmd.leds_blink(2,10) tux.sys.wait(1) Now on daemon side. Ctrl-c on the daemon gives: Daemon closed Daemon closed Could not delete PID file Daemon closed Could not delete PID file Yep looks like we go 3 times through some code where we should go only once. When the daemon was running ps ax gave me root 2467 0.3 3.2 6776 960 pts/1 S+ 23:30 0:00 ./tuxdaemon root 2468 0.0 3.2 6776 960 pts/1 S+ 23:30 0:00 ./tuxdaemon root 2469 0.0 3.2 6776 960 pts/1 S+ 23:30 0:00 ./tuxdaemon root 2470 0.0 3.2 6776 960 pts/1 S+ 23:30 0:00 ./tuxdaemon And with the setuid() code: root 2476 2.0 3.1 6776 940 pts/1 S+ 23:31 0:00 tuxdaemon root 2477 0.0 3.1 6776 940 pts/1 S+ 23:31 0:00 tuxdaemon nobody 2478 0.0 3.1 6776 940 pts/1 S+ 23:31 0:00 tuxdaemon root 2479 0.0 3.1 6776 940 pts/1 S+ 23:31 0:00 tuxdaemon So it's like there is no pthreads, only forked processes and with setuid, only the current process changes actually. And when closing, all forked processes go through the same duplicated code from main(). Phil |