Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 10369  / 2 Years ago, wed, june 8, 2022, 2:54:14

After doing a "sudo su -" on an Ubuntu 12.04 notebook I did a "crontab -e", added this:



* * * * * env DISPLAY=:0.0 /usr/bin/gnome-calculator


and waited for minutes. Nothing Happened. I don't have any external monitors and if I run this command "env DISPLAY=:0.0 /usr/bin/gnome-calculator" in the terminal, it just works. But not from cron. Why?



The syslog only contains this:



May 24 14:37:01 localhost cron[1227]: (root) RELOAD (crontabs/root)
May 24 14:37:01 localhost CRON[16432]: (root) CMD (env DISPLAY=:0.0 /usr/bin/gnome-calculator )


And I already tried an "xhost +localhost".



[root@NOTEBOOK /var/log] xhost
access control enabled, only authorized clients can connect
INET:localhost.localdomain
SI:localuser:USERNAME
[root@NOTEBOOK /var/log]


So the solution for another question like this on askubunut didn't worked.


More From » xorg

 Answers
2

Rewritten as an answer per OP's request.



It's probably not a good idea to put this in the root crontab un the first place. Have you tried putting it un your user crontab?


[#25038] Thursday, June 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tinchir

Total Points: 300
Total Questions: 116
Total Answers: 119

Location: American Samoa
Member since Sun, Jan 17, 2021
3 Years ago
tinchir questions
Tue, Sep 14, 21, 23:11, 3 Years ago
Mon, Dec 19, 22, 13:00, 1 Year ago
Sat, Feb 5, 22, 11:36, 2 Years ago
Mon, Aug 8, 22, 02:16, 2 Years ago
;