Lieting,
I believe I ran into the same issue and cleared it up with this patch to
mod_python.c:
--- mod_python.c.orig 2008-09-24 10:52:17.000000000 +1000
+++ mod_python.c 2008-09-24 10:59:06.000000000 +1000
@@ -510,6 +510,11 @@
/* Set up the python path to be able to load module from our module path */
set_python_path(path);
Py_Initialize();
+
+ PyObject *sys_path = PySys_GetObject("path");
+ PyObject *addpath = PyString_FromString(path);
+ PyList_Append(sys_path, addpath);
+
PyEval_InitThreads();
gtstate = PyEval_SaveThread();
This does the equivalent of a 'sys.path.append(path)' without any error
handling. I haven't heard back from the developer list whether this is the
right approach but perhaps it will get you going for now.
Gilad
----- Original Message ----
From: Lieting Yu <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, September 12, 2008 11:45:03 PM
Subject: [Ganglia-general] mod_python on Solaris not scanning directory
Hi,
I have this weird issue of mod_python does not scan directory. The same
configuration file works fine on Linux. Then I added a print line in
mod_python.c:
526 while ((entry = readdir(dp)) != NULL) {
527 printf("DEBUG: dnio=%d, d_name=%s\n", entry->d_ino,
entry->d_name);
528 modname = is_python_module(entry->d_name);
What I found out that entry->d_name is always empty, though the d_ino seems to
be correct:
[EMAIL PROTECTED]:~/ganglia/ganglia-3.1.1/sbin]# ./gmond -c
../../etc/gmond-named-unicast.conf -m -d 10
loaded module: python_module
DEBUG: dnio=9366496, d_name=
DEBUG: dnio=29645070, d_name=
DEBUG: dnio=9366497, d_name=
DEBUG: dnio=9366498, d_name=
Here are the inodes of the files in that directory:
9366496 drwxrwsrwx 2 yul yul 4096 Sep 11 22:36 .
29645070 drwxr-sr-x 14 yul yul 4096 Sep 11 23:44 ..
9366497 -rw-r--r-- 1 yul yul 3573 Sep 11 14:54 example.py
9366498 -rw-rw-r-- 1 root yul 1963 Sep 11 22:36 example.pyc
This results in "is_python_module" always return NULL.
Has anybody run into issues like this?
Thanks,
Lieting
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general