Cronjob / Virtual terminal problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a simple python program that takes backups. It calls rsnapshot, but the python program does 2 things
A) It checks if mij external drive is mounted, if not it uses gio.VolumeMonitor to detect mounting, and if the correct one is mounted it proceeds
B) uses pynotify to give notifications (External drive is not mounted, taking backup, ...).

This works perfectly when I'm logged in (in X), and starting the program in gnome-terminal.

When I try this in a cronjob (using DISPLAY=:0, which is not foolproof but works for me in 99.99999% of the cases), and setting the correct dbus session vars with
"
for file in `ls -1tr ~/.dbus/session-bus/`; do
    source ~/.dbus/session-bus/"$file"
done

"

this does NOT work. I see the notifications (dbus seems working), but the mount-added signal from VolumeMonitor is never received.
Also when I try this in a virtual-terminal (ctrl-alf-f2), it doesn't work (same problem, notifications are working, mount-added signal is noet).

When I used the exact same script in Ubuntu (11.04) it worked perfectly.


So: what is the difference between a virtual-terminal and cronjob on the one side, and X (gnome-terminal) on the other side when the correct environment variables are set?
And what is the difference between Ubuntu and Fedora?

I personally could only think of one thing and that is selinux, but I disabled that with "setenforce 0", and that didn't help.


So Does anyone have an idea what the problem is, and how I can solve it? (One idea could be to not use VolumeMonitor, but a while loop that checks availability, but that does seem to be a nasty hack).

Greetings,
Nathan

--
To understand recursion, you must first understand recursion.

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux