<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Folks,<br class=""><br class="">Got to a point where I am really looking for help now as I am running out of ideas and hitting the limits of my skills/experience on this one. This is the context of my issue:<br class=""><br class="">I’ve tried a great many things to get a Qt/DBus application to work under automation, but it only works when run directly.manually by a human in a terminal .. and the application is intended for cron automation or automation by a parent process.<br class="">So I’ve hit a dead end now in being able to automate, an otherwise working script/application and thus the whole project is blocked on this issue .. as things can sometimes happen. :)<br class=""><br class="">The application itself is a Qt GUI application which comes with a Perl library for automation and DBus is used in between the Perl and the Qt QUI application (which runs with no window when being automated in this manner.) It processes log files and needs automation because it has so many input variations and usage modes and is needed sometimes to process a lot of logs in an automated context.<br class=""><br class="">The issue itself:<br class=""><br class="">On Mac OSX, both on Yosemite and El Capitan, the perl-dbus script, using the App’s perl library, works perfectly when run manually, by a human, in the terminal.<br class=""><br class="">The same perl-dbus script, when run from a crontab entry OR when run from a parent python script (launching it using the subprocess module) will always fail with this error:<br class=""><br class="">"Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!<br class="">org.freedesktop.DBus.Error.NoMemory: Not enough memory"<br class=""><br class="">(Process exit status is 255.)<br class=""><br class="">The ONLY way the perl-dbus script runs (and runs perfectly) is manually.<br class=""><br class="">ALL of the following combinations fail the same way:<br class="">perl-dbus script run from cron<br class="">parent python script running perl-dbus script, python parent script run from cron<br class="">parent python script running perl-dbus script, python parent script run manually<br class="">ALSO,<br class="">I tried getting an interactive shell using python+pexpect+ssh, had a python parent script ssh to localhost (hence the idea being I would now have an interactive shell) and then simulate typing the perl-dbus command, then wait for pattern match of a returned prompt etc) I actually thought this would solve the environment-variable/interactive-prompt issue .. but it did not work either.<br class=""><br class="">I realize the problem may lie in how DBus is trying to identify it’s session, either by which PID it is trying to identify, which user or via some environment variable. Idea being .. what is different about all the contexts in which it does not work?<br class=""><br class="">Any help will be greatly appreciated by quite a number of folks actually.<br class=""><br class="">Regards,<br class="">Jim<br class=""><br class=""><a href="mailto:zerosyntax@yahoo.com" class="">zerosyntax@yahoo.com</a><br class=""><br class="">Contractor/Python-Programmer/Automation-System Architect .. currently working on a project automating testing at Apple.<br class=""><br class="">##<br class="">#<div class=""><br class=""></div></body></html>