After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 354518 - Dogtail headless does not work
Dogtail headless does not work
Status: RESOLVED FIXED
Product: dogtail
Classification: Deprecated
Component: Framework
0.6.0
Other All
: Normal critical
: ---
Assigned To: Dogtail Maintainers
Dogtail Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-05 21:14 UTC by Phil Muldoon
Modified: 2006-09-18 21:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Phil Muldoon 2006-09-05 21:14:19 UTC
Steps to reproduce:
1. dogtail-run-headless -n /usr/share/doc/dogtail-0.5.2/examples/gedit-test-utf8-procedural-api.py 


Stack trace:
[pmuldoon@dhcp-199 examples]$ dogtail-run-headless -n /usr/share/doc/dogtail-0.5.2/examples/gedit-test-utf8-procedural-api.py
xinit /tmp/dogtail-headless-xinitrc.4384 -- /usr/bin/Xvfb :1 -screen 0 1024x768x16 -ac -noreset -shmem
screen 0 shmid 2916378

GTK Accessibility Module initialized
sh: /usr/share/doc/dogtail-0.5.2/examples/gedit-test-utf8-procedural-api.py: Permission denied


[pmuldoon@dhcp-199 examples]$ su
Password: 
[root@dhcp-199 examples]# dogtail-run-headless -n /usr/share/doc/dogtail-0.5.2/examples/gedit-test-utf8-procedural-api.py
Temporarily enabling accessibility support for GNOME
xinit /tmp/dogtail-headless-xinitrc.4439 -- /usr/bin/Xvfb :1 -screen 0 1024x768x16 -ac -noreset -shmem
screen 0 shmid 2949149

GTK Accessibility Module initialized
sh: /usr/share/doc/dogtail-0.5.2/examples/gedit-test-utf8-procedural-api.py: Permission denied

with -g I get:

[root@dhcp-199 ~]# dogtail-run-headless -g /usr/share/doc/dogtail-0.5.2/examples/gedit-test-utf8-procedural-api.py
Traceback (most recent call last):
  • File "/usr/bin/dogtail-run-headless", line 188 in ?
    try: exitCode = main(sys.argv)
  • File "/usr/bin/dogtail-run-headless", line 151 in main
    xinitrc.write('cd %s && dogtail-detect-session && sh -c "%s"; echo -n \$? > %s\n') % (os.getcwdu(), script, exitCodeFile)
TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'
Traceback (most recent call last):
  File "/usr/bin/dogtail-run-headless", line 193, in ?
    cleanup()
  File "/usr/bin/dogtail-run-headless", line 180, in cleanup
    os.remove(exitCodeFile)
OSError: [Errno 2] No such file or directory: '/tmp/dogtail-headless-exitcode.4485'





Other information:
In addition there are several other issues covered in Stepan Kasal's email to dogtail list that need to be addressed in a build host environment (ie where is not available at all).

http://mail.gnome.org/archives/dogtail-devel-list/2006-August/msg00016.html

Should I open another bug for above mail?
Comment 1 Zack Cerza 2006-09-06 14:40:32 UTC
dogtail-run-headless calls /bin/sh to execute the script argument you pass to it. That could theoretically be a shell snippet, e.g. 'rm -rf /tmp/foo; ~/bar.py'. /bin/sh is refusing to execute files that do not have the executable bit set, which is its correct behavior. The actual bug is that the packages you're using have the executable bit unset on the example scripts. I would love to set the bit in the Fedora packages, but if you look in the package changelog you'll see that I had to unset it because of packaging policy.

As for the issues in the mail, I believe they're all fixed. I'm not sure about the XFS problem; you'd probably want to ask an X person.
Comment 2 Phil Muldoon 2006-09-06 14:57:23 UTC
Zack, thanks for the reply. I'll take your last reply first ;)

"As for the issues in the mail, I believe they're all fixed. I'm not sure about
the XFS problem; you'd probably want to ask an X person."

Arguably as this is all contained within the dogtail-run-headless script, it is more our issue, the users and the developers of dogtail. Fact is, on a true headless system, dogtail-run-headless does not work at all. It requires more setup. Right now dogtail-run-headless works on a system with X + Display, but it does not draw to the display. 

Stepan had a theory that might work on a true headless system, and I have CC'd him to the bug.

The second issues:

You are right, setting the +x bit works in the  -n mode, like so 

dogtail-run-headless -n ./gedit-test-utf8-procedural-api.py

however, using -g still spawns:

[root@localhost examples]# dogtail-run-headless -g gedit-test-utf8-procedural-api.py 
Traceback (most recent call last):
  • File "/usr/bin/dogtail-run-headless", line 188 in ?
    try: exitCode = main(sys.argv)
  • File "/usr/bin/dogtail-run-headless", line 151 in main
    xinitrc.write('cd %s && dogtail-detect-session && sh -c "%s"; echo -n \$? > %s\n') % (os.getcwdu(), script, exitCodeFile)
TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'
Traceback (most recent call last):
  File "/usr/bin/dogtail-run-headless", line 193, in ?
    cleanup()
  File "/usr/bin/dogtail-run-headless", line 180, in cleanup
    os.remove(exitCodeFile)
OSError: [Errno 2] No such file or directory: '/tmp/dogtail-headless-exitcode.21949'
Comment 3 Phil Muldoon 2006-09-06 15:01:41 UTC
I would also respectfully petition this bug be reopend, until we have fully explored all the issues.
Comment 4 Zack Cerza 2006-09-06 15:06:22 UTC
Which issue prevents dogtail-run-headless to work on a true headless system? I wasn't able to get that out of the original mail.

I'll look into the -g problem now. And yes, you were right to reopen :)
Comment 5 Zack Cerza 2006-09-06 15:10:24 UTC
OK, I can't reproduce that at all. What distro are you using?
Comment 6 Phil Muldoon 2006-09-06 15:21:57 UTC
"OK, I can't reproduce that at all. What distro are you using?"

FC6 - Test 2, basically tracking rawhide.

rpm -q dogtail
dogtail-0.5.2-3.fc6

rpm -q pyspi
pyspi-0.5.5-1.fc6
Comment 7 Zack Cerza 2006-09-06 16:41:37 UTC
XFS: From what I understand, X needs to be able to talk to the font server.

For the TypeError, I was in fact able to reproduce that on rawhide. It appears to be a python bug:

this:

xinitrc.write('cd %s && dogtail-detect-session && sh -c "%s"; echo -n $? > %s\n') % (os.getcwdu(), script, exitCodeFile)

no longer works, but this:

s = 'cd %s && dogtail-detect-session && sh -c "%s"; echo -n $? > %s\n' % (os.getcwdu(), script, exitCodeFile)
xinitrc.write(s)

does.
Comment 8 Zack Cerza 2006-09-07 20:36:11 UTC
I just committed a fix that should take care of everything but the XFS problem, which is really just an X problem that needs to be fixed per distribution.
Comment 9 Zack Cerza 2006-09-18 21:07:49 UTC
The bug was fixed in 0.6.0.