I need to run an executable every 15 mins and I wrote a crontab to do so.The executable makes use of the freeglut library.However, I always get this error:
freeglut (./WeatherProj): failed to open display ‘’
i think this is because of relative path issues…is there anyother way to run the executable in regular intervals without any such issues?
any help would be greatly appreciated.
Check your crontab user has access to X.
Check an X server is running.
Check the $DISPLAY env var is set to correct display, within your crontab env.
Typically, set to DISPLAY=:0.0 (points to first screen of first display on the local machine).
With that, assuming the X server is running, only issue is whether you have write access to the display. If your crontab is running as the same user that’s logged into X, then you should be good, as your crontab will see the ~/.Xauthority file (magic cookie) and use that for access. If diff user, can also use xauth to transfer the cookie to the user that needs access. Failing that, you’ll need to grant X access to the user your running your crontab under via one of several mechanisms (modifying X server access perms in config file, xhost + run after logging into X, etc.). Be aware of the security implications of what you’re doing.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.