Support #729

audtool not working using cron

Added by Sylvain LABOISNE 5 months ago. Updated 4 months ago.

Status:Closed Start date:July 02, 2017
Priority:Minor Due date:
Assignee:- % Done:

0%

Category:audtool
Target version:-
Affects version:3.8.2

Description

Hello guys !

I'm trying to get information from audtool, but it doesn't work using cron schedule.

I'm on Archlinux 4.11.7-1-ARCH

Step to reproduce :

1/ Start Audacious, and play some audio files -should be already done :)

2/ Take the script in attachment and put it in /tmp. Make it executable (chmod +x)

3/ Execute it : you get something like :
PID Audacious : 3362
audstat : playing
paused : 1
playing : 0

4/ do an crontab -e and put a line :
*/1 * * * * /tmp/test_cron_audtool.sh > /dev/null

5/ Wait next cron execution, and check the content of /tmp/aud-status. I have :
PID Audacious : 3362
audstat :
paused : 1
playing : 1

-> This is not expected, I should get same as 3/
As I get some values, there's no errors in cron, and audtool is executed (getting paused and playing values, even if they're wrong).

Any ideas ?

P.S. : delete the line in your cron.

test_cron_audtool.sh Magnifier (346 Bytes) Sylvain LABOISNE, July 02, 2017 13:42

History

#1 Updated by John Lindgren 5 months ago

  • Tracker changed from Bug to Support

Are you running the cron job from the same D-Bus session as Audacious?

#2 Updated by Sylvain LABOISNE 5 months ago

Well, audacious and my crontab -e are on the same session. How can I check that d-bus session is the same ?

#3 Updated by John Lindgren 5 months ago

Sylvain LABOISNE wrote:

Well, audacious and my crontab -e are on the same session. How can I check that d-bus session is the same ?

echo $DBUS_SESSION_BUS_ADDRESS

#4 Updated by Sylvain LABOISNE 5 months ago

unix:path=/run/user/1000/bus
1000 is me according to /etc/passwd

#5 Updated by John Lindgren 5 months ago

That's set in your cron script as well?

#6 Updated by Sylvain LABOISNE 4 months ago

Do I need to put something else to set dbus session ?
I tried :
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus;/to/my/script > /dev/null
No better results.

#7 Updated by John Lindgren 4 months ago

I'm not sure if it will solve the issue, but I think you need to remove the semicolon in the middle of that command.

#8 Updated by Sylvain LABOISNE 4 months ago

My mistake.

Indeed, it works now, the problem comes from the cron job that don't know my dbus session, putting that in crontab -e fixed it :

*/1 * * * * DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus /path/to/my/script

To know what to put after the "=", do a :

echo $DBUS_SESSION_BUS_ADDRESS

Thanks for help and for this great media player ! You can close this support issue.

#9 Updated by John Lindgren 4 months ago

  • Status changed from New to Closed

Also available in: Atom PDF