I write a cgi script in python just send a notification command,but that can not work for me.
Code:
#!/usr/bin/env python
#-*-coding=utf-8-*-
import cgi
import os
print 'Content-Type:text/html\n\n'
os.system("notify-send 'hello'")
And
Code:
djstava@Gateway:~/test$ notify-send 'hello'
is OK.
This is the error.
Code:
djstava@Gateway:/tmp$ cat notify-error
libnotify-Message: Unable to get session bus: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.
** (notify-send:4642): CRITICAL **: dbus_g_proxy_connect_signal: assertion `DBUS_IS_G_PROXY (proxy)' failed
** (notify-send:4642): CRITICAL **: dbus_g_proxy_connect_signal: assertion `DBUS_IS_G_PROXY (proxy)' failed
** (notify-send:4642): CRITICAL **: dbus_g_proxy_call: assertion `DBUS_IS_G_PROXY (proxy)' failed
libnotify-Message: Unable to get session bus: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.
** (notify-send:4642): CRITICAL **: dbus_g_proxy_disconnect_signal: assertion `DBUS_IS_G_PROXY (proxy)' failed
** (notify-send:4642): CRITICAL **: dbus_g_proxy_disconnect_signal: assertion `DBUS_IS_G_PROXY (proxy)' failed
(notify-send:4642): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed