• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can't get cron to launch realplayer

I'm using a gentoo box with vixie-cron.

I followed the guides to allow my user to access crontab.

I tested out some basic commands like echoing "test" to a file. That works fine. What doesn't work is starting /usr/bin/realplayer or /usr/bin/gedit. I tried making a script that would itself run realplayer and starting the script from cron but that doesn't seem to work. I didn't see anything in the logs.

What is happening here? How do I get cron to launch an X program.
 
15 21 * * 1-5 /usr/bin/realplay

15 21 * * 1-5 /usr/bin/realplay >> /home/user/test
doesn't do anything

echo $DISPLAY:
:0.0
 
Originally posted by: Infohawk
15 21 * * 1-5 /usr/bin/realplay

15 21 * * 1-5 /usr/bin/realplay >> /home/user/test
doesn't do anything

echo $DISPLAY:
:0.0
$DISPLAY from your shell shouldn't matter, it's the $DISPLAY that's set where cron runs realplay that counts. I imagine you want to write a script that sets $DISPLAY and then starts reaplay and then call the script from cron, but I don't know if you can one-line it and keep in all in the crontab.
 
Just noticed a file called dead.letter in ~/

* ERROR **: Unable to open display
aborting...
/usr/bin/realplay: line 75: 15391 Aborted $REALPLAYBIN "$@"



(gedit:15561): Gtk-WARNING **: cannot open display:



** ERROR **: Unable to open display
aborting...
/usr/bin/realplay: line 75: 16053 Aborted $REALPLAYBIN "$@"

So I need to make a bash script that sets the display variable? WHich variable do I want the script to set?
 
You want to set $DISPLAY, presumably to ":0.0" if you want it on the same display that you're using currently.
 
Originally posted by: Infohawk
That gives me:

** ERROR **: Unable to open display
aborting...
/usr/bin/realplay: line 75: 10798 Aborted $REALPLAYBIN "$@"

There you go, there's the problem. I can't see anything wrong with your script though, so I'm not sure how to fix it off hand. I'll try to play around.
 
I tried to export this but now nothing seems to happen, not even the error.

#!/bin/bash
export DISPLAY=localhost:0.0
/usr/bin/realplay

When I export, I don't need the "$" before the variable right?

Perhaps I'm going about this the wrong way. Is there a gnome utility that launches apps at a certain time?
 
I can never figure out the correct syntax for setting env variables in different shells withouth a lot of fooling around. In your bash script, try "echo $DISPLAY" right after setting it to make sure you've got it right. (Be sure to pipe the output of the script still, or you won't see what it prints).
 
Originally posted by: kamper
I can never figure out the correct syntax for setting env variables in different shells withouth a lot of fooling around. In your bash script, try "echo $DISPLAY" right after setting it to make sure you've got it right. (Be sure to pipe the output of the script still, or you won't see what it prints).

localhost:0.0
 
If all you are doing is playing an audio file, I would just use the mplayer command line to get this done. I'm not a big rp fan in the windows or linux world.
 
Back
Top